fixed #924: When opening image editor it will check is clipboard contains image and ask would you like to load it

This commit is contained in:
Jaex 2015-08-22 16:44:40 +03:00
parent d4196b10e9
commit 003bd9fb69

View file

@ -650,6 +650,20 @@ public static void OpenImageEditor(string filePath = null)
{
if (string.IsNullOrEmpty(filePath))
{
if (Clipboard.ContainsImage() &&
MessageBox.Show("Your clipboard contains image, would you like to open it in image editor?\r\n\r\nYes = Open image from clipboard.\r\nNo = Open image file dialog.",
"Image editor - How to load image?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
using (Image img = Clipboard.GetImage())
{
if (img != null)
{
AnnotateImage(img, null);
return;
}
}
}
filePath = ImageHelpers.OpenImageFileDialog();
}