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;