![]() |
Transparente Bitmap einfügen
Hallo zusammen
Ich möchte auf einen Farbverlauf eine Bitmap mit transparentem Hintergrund kopieren:
Delphi-Quellcode:
Aber das funktioniert nicht, der Farbverlauf ist im Hintergrund der Bitmap nicht mehr zu sehen... :?
function CreateMask(Bitmap: TBitmap): TBitmap;
var MaskBmp: TBitmap; begin MaskBmp:= TBitmap.Create; with MaskBmp do try Assign(Bitmap); Mask(Bitmap.Canvas.Pixels[0, Bitmap.Height - 1]); MaskHandle except MaskBmp.Free; raise; end; Result:= MaskBmp; end; procedure DrawTransparent(const DestDC: HDC; const X, Y: Integer; Bitmap: TBitmap); var Mask: TBitmap; begin Mask:= CreateMask(Bitmap); try MaskBlt(DestDC, X, Y, Bitmap.Width, Bitmap.Height, Bitmap.Canvas.Handle, 0, 0, Mask.MaskHandle, 0, 0, MAKEROP4(MERGECOPY, SRCCOPY)); // Zweite Variante, geht auch nicht { BitBlt(DestDC, X, Y, Bitmap.Width, Bitmap.Height, Mask.Canvas.Handle, 0, 0, SRCAND); BitBlt(DestDC, X, Y, Bitmap.Width, Bitmap.Height, Bitmap.Canvas.Handle, 0, 0, SRCINVERT);} finally Mask.Free; end; end; Kann mir wer helfen? Gruss Shaman |
Re: Transparente Bitmap einfügen
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:01 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