From: keeper@mindspring.com (Mark R. Johnson)
Subject: Re: Delphi: Transblt
Date: 17 May 1995 13:28:13 GMT

In article <bseeley.1.2FB90367@mendel.usu.edu>,
   bseeley@mendel.usu.edu (Brent Seeley) wrote:
>Does anyone have an example of doing a transparent bitblt in Delphi, or 
>Borland Pascal for windows.  I am translating a Visual Basic program which 
>requires it.  Any help will be very appreciated.
>
>Bseeley@mendel.usu.edu

Try this:

  with Canvas do begin
    CopyMode := cmSrcAnd;
    Draw(0, 0, FBitmask);
    CopyMode := cmSrcPaint;
    Draw(0, 0, FBitmap);
  end;

FBitmask contains the images with all "transparent" pixels
set to white and all opaque pixels set to black.  FBitmap
contains the image with all "transparent" pixels set to
black.

The mask acts as a sort of cookie-cutter to cut a whole in
the underlying image.  The bitmap is then OR'ed in, leaving
the underlying image intact where the bitmap has black
pixels.

______________________________________________________________________________
 Mark R. Johnson       _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
 Atlanta, GA USA       _/  http://www.mindspring.com/~cityzoo/cityzoo.html  _/
 keeper@mindspring.com _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
