Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi Png auf Png kopieren (https://www.delphipraxis.net/119393-png-auf-png-kopieren.html)

dominikkv 25. Aug 2008 20:58


Png auf Png kopieren
 
Ähm... komm grad nicht weiter :/

Also ich habe ein TImage in dem ein png mit Transparenz liegt. Ich habe ein zweites TImage mit einem zweiten png mit Transparenz. Dieses 2te Image soll nun auf das erste gemalt werden. Wie mache ich das am besten?

Delphi-Quellcode:
First.Canvas.Draw(0, 0, Second.Picture.Bitmap);
BitBlt(First.Picture.Bitmap.Handle, 0, 0, Second.Width, Second.Height, Second.Picture.Bitmap.Handle, 0, 0, SRCCOPY);
Es kommt immer die Fehlermeldung: "Bild kann nur geändert werden, wenn es ein Bitmap enthält"
Also habe ich versucht das in ein Bitmap umzuwandeln:
Delphi-Quellcode:
procedure ConvertToBitmapImg(Image: TImage);
var TmpPic: TPicture;
begin
  TmpPic := TPicture.Create;
  try
    TmpPic.Bitmap.Assign(Image.Picture.Graphic);
    Image.Picture.Bitmap.Assign(TmpPic.Bitmap);
  finally
    TmpPic.Free;
  end;
end;
...sieht scheußlich aus :pale:

jemand ne Idee?


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:58 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz