Skip to content

Commit

Permalink
include current color channel option when copying image
Browse files Browse the repository at this point in the history
  • Loading branch information
d2phap committed May 26, 2024
1 parent 9b3bb2d commit 49d1f1c
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions Source/ImageGlass/FrmMain/FrmMain.IGMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1193,13 +1193,7 @@ public async Task CopyImageDataAsync()
{
if (PicMain.Source == ImageSource.Null) return;

var bitmap = Local.ClipboardImage;
if (bitmap == null)
{
var img = await Local.Images.GetAsync(Local.CurrentIndex);
bitmap = img?.ImgData?.Image;
}

var bitmap = PicMain.GetRenderedBitmap();
if (bitmap == null) return;

var langPath = $"{Name}.{nameof(MnuCopyImageData)}";
Expand All @@ -1212,7 +1206,7 @@ public async Task CopyImageDataAsync()
{
bitmap = BHelper.CropImage(bitmap, PicMain.SourceSelection);
}

await Task.Run(() => ClipboardEx.SetClipboardImage(bitmap));

PicMain.ShowMessage(Config.Language[$"{langPath}._Success"], Config.InAppMessageDuration);
Expand Down

0 comments on commit 49d1f1c

Please sign in to comment.