mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
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:
parent
d4196b10e9
commit
003bd9fb69
1 changed files with 14 additions and 0 deletions
|
@ -650,6 +650,20 @@ public static void OpenImageEditor(string filePath = null)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(filePath))
|
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();
|
filePath = ImageHelpers.OpenImageFileDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue