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
 Copy TBitmap to clipboard with transparency?

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 - Nov 30 2024 : 14:47:39
I create a TBitmap from an external object (the bitmap is not originally transparent and has a solid non-transparent background):

    ABitmap := AOfficeImage.GetAsBitmap;
    ABitmap.Transparent := True;
    ABitmap.PixelFormat:= pf32bit;
 
    // Copy the Bitmap to the clipboard:
    With TImageEnProc.Create( nil ) do
    begin
      AttachedIEBitmap.Assign(ABitmap);
      AttachedIEBitmap.AlphaChannel;
      AttachedIEBitmap.AlphaFill(0);

      CopyToClipboard(False); // clipboard image is still intransparent
      Free();
    end;

    ABitmap.Free;


*****

Other approach with TBitmap helper function:

    ABitmap := AOfficeImage.GetAsBitmap;
    ABitmap.Transparent := True;
    ABitmap.PixelFormat:= pf32bit;

    ABitmap.Proc.CopyToClipboard(False); // image is still not transparent

    ABitmap.Free;
1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Dec 01 2024 : 00:41:56
Hi

Yes, that code should include a PNG clipboard format that includes an alpha channel (in fact the pasted image should be completely blank in applications that support an alpha channel).

What application are you you pasting into?

Also check that AttachedIEBitmap.AlphaChannel.Full = False.


Nigel
Xequte Software
www.imageen.com