PDA

Click to See Complete Forum and Search --> : Bitblt transparent without black bg


Sastraxi
Mar 12th, 2001, 01:25 PM
How would u bitblt tranparently without the use of a black bg and Bitblt or Transparent? I have some pics with green backgrounds, but can't be bothered to change all of the bgs to black, for there are some black parts in the pic.

Can I do this?

Mar 12th, 2001, 06:47 PM
Use a Mask. Take your image. Create a new image
that is the same size as your image. Every part of the
image that you want to show up, make that part of the
mask black. everything else, white. Use BitBlt, in this
order:

Blt the background that you want your sprite to show
up on (eg, your map thing)

Blt the mask on top of the map thing, using MergePaint

Blt the sprite on top of the mask with SrcAnd.

That should work, im taking the code from VB Graphics
Programming. Great book, by the way.

Z.

Sastraxi
Mar 12th, 2001, 07:26 PM
*SASTRAXI STOMPS HIS FEET MADLY*
I HAVE THAT BOOK, TOO!!!!
I am sooooo annoyed with myself.

BTW, thanks for the code, Zaei!