Use after capture tasks on annotate image result

This commit is contained in:
Jaex 2016-09-05 12:21:32 +03:00
parent e9ad46700b
commit 68d0ad1413
2 changed files with 32 additions and 18 deletions

View file

@ -150,30 +150,38 @@ public static void ShowScreenRuler(RegionCaptureOptions options)
}
}
public static void AnnotateImage(string filePath, RegionCaptureOptions options)
public static Image AnnotateImage(string filePath, RegionCaptureOptions options)
{
if (File.Exists(filePath))
{
using (Image img = ImageHelpers.LoadImage(filePath))
using (RegionCaptureForm form = new RegionCaptureForm(RegionCaptureMode.Editor))
{
form.Config = GetRegionCaptureOptions(options);
form.Config.DetectWindows = false;
form.Config.ShowTips = false;
form.Config.UseDimming = false;
form.Prepare(img);
form.ShowDialog();
if (form.Result == RegionResult.Region)
{
using (Image result = form.GetResultImage())
{
ImageHelpers.SaveImage(result, filePath);
}
}
return AnnotateImage(img, options);
}
}
return null;
}
public static Image AnnotateImage(Image img, RegionCaptureOptions options)
{
using (RegionCaptureForm form = new RegionCaptureForm(RegionCaptureMode.Editor))
{
form.Config = GetRegionCaptureOptions(options);
form.Config.DetectWindows = false;
form.Config.ShowTips = false;
form.Config.UseDimming = false;
form.Prepare(img);
form.ShowDialog();
if (form.Result == RegionResult.Region)
{
return form.GetResultImage();
}
}
return null;
}
public static Image ApplyRegionPathToImage(Image img, GraphicsPath gp)

View file

@ -606,7 +606,13 @@ public static void OpenImageEditor(string filePath = null, TaskSettings taskSett
if (!string.IsNullOrEmpty(filePath))
{
RegionCaptureHelpers.AnnotateImage(filePath, taskSettings.CaptureSettingsReference.SurfaceOptions);
Image img = RegionCaptureHelpers.AnnotateImage(filePath, taskSettings.CaptureSettingsReference.SurfaceOptions);
if (img != null)
{
UploadManager.RunImageTask(img, taskSettings);
}
//AnnotateImage(filePath);
}
}