Forum > GTK

Clipboard transparent bitmap

(1/1)

benohb:

--- Code: ---Load from clipboard
uses
  Clipbrd, LCLIntf, LCLType, ...;
 
procedure LoadBitmapFromClipboard(Bitmap: TBitmap);
begin
  if Clipboard.HasFormat(PredefinedClipboardFormat(pcfDelphiBitmap)) then
    Bitmap.LoadFromClipboardFormat(PredefinedClipboardFormat(pcfDelphiBitmap));
  if Clipboard.HasFormat(PredefinedClipboardFormat(pcfBitmap)) then
    Bitmap.LoadFromClipboardFormat(PredefinedClipboardFormat(pcfBitmap));
end;
Save to clipboard
uses
  Clipbrd, ...;
 
procedure SaveBitmapToClipboard(Bitmap: TBitmap);
begin
  Clipboard.Assign(Bitmap);
end;
--- End code ---

This tutorial is not work with transparent (Transparency = black)  :'(
Any ideas

taazz:
use 32bit bitmaps with alpha channel set to transparent perhaps?

benohb:

--- Quote ---use 32bit bitmaps with alpha channel set to transparent perhaps?

--- End quote ---

NO and YES  :-\ ...black areas and transparent areas both become transparent

Why bits of pixel  is 24bit ...!
I use "canvas.line(0,0,0,0)" to  convert it to 32bit...Is this a normal thing

+The alpha byte Always 0

Navigation

[0] Message Index

Go to full version