Nahum Wild wrote:
>
> If you play with the CopyMode property, part of TCanvas, you should be able
> to achieve what you want - well according to the help anyway!
TCanvas.CopyRect uses the WinAPI call StretchBlt() to copy the data, which
doesn't support transparencies. What you really need to use is
TransparentBlt(). Looking at the way TCanvas.CopyRect operates, you should
be able to do something like:
TransparentBlt(
dest.Handle, dx, dy, dw, dh,
src.Handle, sx, sy, sw, sh,
trans_color);
where 'dest' and 'src' are canvas objects, d<xywh> are the position and
dimensions of the destination and s<xywh> are the same for source. The
trans_color is a 32bit int, so just casting a TColor should work.
Apparently TransparentBlt also handles stretching, just doesn't have the
blend modes that StretchBlt supports.
> The really horrible and ugly option would be to use scanline and run thru
> the bitmap and replace pink with whatever its going over.
This isn't always a bad idea - sometimes it's the best way to perform
complex operations on bitmaps. In this case though I'd go with the WinAPI
transparent bitmap support :>
--
Corey Murtagh
The Electric Monk
"Quidquid latine dictum sit, altum viditur!"
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"