Last region support for rectangle annotate, few changes in version history

This commit is contained in:
Jaex 2014-07-10 02:59:03 +03:00
parent c0f4f26917
commit 57622662f8
3 changed files with 63 additions and 43 deletions

View file

@ -382,7 +382,7 @@ private void DrawTips(Graphics g)
using (Brush brush = new SolidBrush(Color.FromArgb(150, Color.White)))
using (Pen pen = new Pen(Color.FromArgb(150, Color.Black)))
{
backgroundPath.AddRoundedRectangle(textRectangle, 7);
backgroundPath.AddRoundedRectangle(textRectangle, 5);
g.FillPath(brush, backgroundPath);
g.DrawPath(pen, backgroundPath);
}

View file

@ -1225,7 +1225,9 @@ private void tsmiImagePreviewAutomatic_Click(object sender, EventArgs e)
private delegate Image ScreenCaptureDelegate();
private bool isLightCapture;
private enum LastRegionCaptureType { Surface, Light, Annotate }
private LastRegionCaptureType lastRegionCaptureType = LastRegionCaptureType.Surface;
private void InitHotkeys()
{
@ -1610,7 +1612,7 @@ private void CaptureRegion(CaptureType captureType, TaskSettings taskSettings, b
if (img != null)
{
isLightCapture = false;
lastRegionCaptureType = LastRegionCaptureType.Surface;
}
}
finally
@ -1638,7 +1640,7 @@ private void CaptureRectangleAnnotate(TaskSettings taskSettings = null, bool aut
if (img != null)
{
isLightCapture = true;
lastRegionCaptureType = LastRegionCaptureType.Annotate;
}
}
}
@ -1663,7 +1665,7 @@ private void CaptureRectangleLight(TaskSettings taskSettings = null, bool autoHi
if (img != null)
{
isLightCapture = true;
lastRegionCaptureType = LastRegionCaptureType.Light;
}
}
}
@ -1674,39 +1676,56 @@ private void CaptureRectangleLight(TaskSettings taskSettings = null, bool autoHi
private void CaptureLastRegion(TaskSettings taskSettings, bool autoHideForm = true)
{
if (!isLightCapture)
switch (lastRegionCaptureType)
{
if (Surface.LastRegionFillPath != null)
{
DoCapture(() =>
case LastRegionCaptureType.Surface:
if (Surface.LastRegionFillPath != null)
{
using (Image screenshot = Screenshot.CaptureFullscreen())
DoCapture(() =>
{
return ShapeCaptureHelpers.GetRegionImage(screenshot, Surface.LastRegionFillPath, Surface.LastRegionDrawPath, taskSettings.CaptureSettings.SurfaceOptions);
}
}, CaptureType.LastRegion, taskSettings, autoHideForm);
}
else
{
CaptureRegion(CaptureType.Rectangle, taskSettings, autoHideForm);
}
}
else
{
if (!RectangleLight.LastSelectionRectangle0Based.IsEmpty)
{
DoCapture(() =>
using (Image screenshot = Screenshot.CaptureFullscreen())
{
return ShapeCaptureHelpers.GetRegionImage(screenshot, Surface.LastRegionFillPath, Surface.LastRegionDrawPath, taskSettings.CaptureSettings.SurfaceOptions);
}
}, CaptureType.LastRegion, taskSettings, autoHideForm);
}
else
{
using (Image screenshot = Screenshot.CaptureFullscreen())
CaptureRegion(CaptureType.Rectangle, taskSettings, autoHideForm);
}
break;
case LastRegionCaptureType.Light:
if (!RectangleLight.LastSelectionRectangle0Based.IsEmpty)
{
DoCapture(() =>
{
return ImageHelpers.CropImage(screenshot, RectangleLight.LastSelectionRectangle0Based);
}
}, CaptureType.LastRegion, taskSettings, autoHideForm);
}
else
{
CaptureRectangleLight(taskSettings, autoHideForm);
}
using (Image screenshot = Screenshot.CaptureFullscreen())
{
return ImageHelpers.CropImage(screenshot, RectangleLight.LastSelectionRectangle0Based);
}
}, CaptureType.LastRegion, taskSettings, autoHideForm);
}
else
{
CaptureRectangleLight(taskSettings, autoHideForm);
}
break;
case LastRegionCaptureType.Annotate:
if (!RectangleAnnotate.LastSelectionRectangle0Based.IsEmpty)
{
DoCapture(() =>
{
using (Image screenshot = Screenshot.CaptureFullscreen())
{
return ImageHelpers.CropImage(screenshot, RectangleAnnotate.LastSelectionRectangle0Based);
}
}, CaptureType.LastRegion, taskSettings, autoHideForm);
}
else
{
CaptureRectangleAnnotate(taskSettings, autoHideForm);
}
break;
}
}

View file

@ -2,20 +2,21 @@
* Main window menu changes to simplify UI
* Automatic show/hide image preview in main window
* Support to Upload from URL
* Ability to customize URL format when opening the URL
* Better stop upload mechanism (ability to stop stuck uploads)
* Added Tweet Message to Tools menu with hotkey support
* Share URL and shorten URL context menu items for tasks in main window
* ImageShack image uploader changes (better error handling, removed anonymous support)
* Added support to share URL to Facebook, Google+, VK, Reddit, Pinterest and Delicious via web browser
* Share URL and Shorten URL context menu items for tasks in main window
* Google Drive file uploader enhancements (title and folder support)
* Twitter image upload support
* ownCloud file uploader support
* Google Drive file uploader enhancements (title and folder support)
* bit.ly custom domain support
* nl.cm URL shortener support
* Added support to share URL to Facebook, Pinterest, Reddit, Delicious, VK, and Google+ via web browser
* Task setting to disable Aero while screen recording
* bit.ly custom domain support
* Support to Upload from URL
* Added Rectangle (Annotate) to capture menu which will alow drawing in rectangle capture
* Screen recording improvements (timer and stop button under region)
* Task setting to disable Aero while screen recording
* Ability to customize URL format when automatically opening the URL
* Better stop upload mechanism (ability to stop stuck uploads)
* Added Tweet Message to Tools menu with hotkey support
* ImageShack image uploader changes (better error handling, removed anonymous support)
ShareX 9.1.0 - 2014-06-11