ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Preserve transparency when copying to clipboard?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
PeterPanino Posted - Jan 14 2014 : 17:37:51
Hi! How can I COPY an image (previously loaded PNG image with alpha transparency) to the clipboard so that the transparency is preserved when I paste it in any graphics program?
1   L A T E S T    R E P L I E S    (Newest First)
w2m Posted - Jan 14 2014 : 18:17:56
I guess that depends on the graphics program and if the graphic program can handle a image with an alpha channel. There is no way that I know of to guarantee that because you can not change how paste works or even know how paste is handled unless you write the app.

Within ImageEn- Copy preserves PNG transparency:
if ImageEnView1.Selected then
  ImageEnView1.Proc.SelCopyToClip(True)
else
  ImageEnView1.Proc.CopyToClipboard(True);

And Within ImageEn- Paste maintains the PNG transparency:
if ImageEnView1.Proc.IsClipboardAvailable then
begin
  ImageEnView1.Proc.SaveUndoCaptioned
          ('Paste ' + IntToStr(ImageEnView1.Proc.UndoCount));
  if ImageEnView1.Selected then
  begin
    ImageEnView1.Proc.SelPasteFromClip(True);
    ImageEnView1.Update;
  end
  else
    ImageEnView1.Proc.PasteFromClipboard;
end;

I tested Paste with Windows 8.1 Paint and the transparency was not maintained, but with ImageEn itself and with Adobe Photoshop Elements transparency was maintained.

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html