Show info in screen color picker mode

This commit is contained in:
Jaex 2015-01-24 08:54:50 +02:00
parent ea62f79fab
commit 9b90841966
3 changed files with 28 additions and 1 deletions

View file

@ -238,6 +238,12 @@ protected override void Draw(Graphics g)
}
}
if (OneClickMode && Config.ShowInfo)
{
ImageHelpers.DrawTextWithOutline(g, GetColorPickerText(), new PointF(InputManager.MousePosition0Based.X + 5, InputManager.MousePosition0Based.Y + 5),
textFont, Color.White, Color.Black);
}
if (Config.ShowMagnifier)
{
DrawMagnifier(g);
@ -261,6 +267,13 @@ private string GetAreaText(Rectangle area)
return string.Format(Resources.RectangleRegion_GetAreaText_Area, area.X, area.Y, area.Width, area.Height);
}
private string GetColorPickerText()
{
Point mousePos = InputManager.MousePosition0Based;
Color color = ((Bitmap)SurfaceImage).GetPixel(mousePos.X, mousePos.Y);
return string.Format(Resources.RectangleRegion_GetColorPickerText, mousePos.X, mousePos.Y, color.R, color.G, color.B);
}
private void DrawCrosshair(Graphics g)
{
int offset = 5;
@ -301,7 +314,7 @@ private void DrawMagnifier(Graphics g)
Rectangle currentScreenRect0Based = CaptureHelpers.ScreenToClient(Screen.FromPoint(InputManager.MousePosition).Bounds);
int offsetX = RulerMode ? 20 : 10, offsetY = RulerMode ? 20 : 10;
if (Config.ShowInfo && AreaManager.IsCurrentAreaValid && AreaManager.CurrentArea.Location == mousePos)
if (Config.ShowInfo && ((AreaManager.IsCurrentAreaValid && AreaManager.CurrentArea.Location == mousePos) || OneClickMode))
{
offsetY = RulerMode ? 85 : 50;
}

View file

@ -181,6 +181,16 @@ internal static string RectangleRegion_GetAreaText_Area {
}
}
/// <summary>
/// Looks up a localized string similar to X: {0}, Y: {1}
///R: {2}, G: {3}, B: {4}.
/// </summary>
internal static string RectangleRegion_GetColorPickerText {
get {
return ResourceManager.GetString("RectangleRegion_GetColorPickerText", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to X: {0} / Y: {1} / X2: {2} / Y2: {3}
///Width: {4} px / Height: {5} px

View file

@ -167,4 +167,8 @@ Distance: {6:0.00} px / Angle: {7:0.00}°</value>
<data name="RectangleAnnotate_DrawTips_Drawing_mode_off" xml:space="preserve">
<value>Ctrl: Drawing mode ░ Space: Fullscreen capture</value>
</data>
<data name="RectangleRegion_GetColorPickerText" xml:space="preserve">
<value>X: {0}, Y: {1}
R: {2}, G: {3}, B: {4}</value>
</data>
</root>