For transparency, you have to copy the Mask down first with an OP Code of SRCAND and then the Sprite with an OP code of SRCPAINT.
TERMS
SRCAND: Copies all colours but white
SRCPAINT: Copies all colours but black
A Mask is like a black and white version of the Picture. The background is coloured white and the actual graphic is coloured black regardless of the original color.
A Sprite is your normal image. It must have a black background and. The reason is as follows: You to copy the Mask down with SRCAND, and all the colours but the white is copied, leaving us with a pure black version of our picture. Next we copy down the Sprite with SRCPAINT. This will copy all but black so it leaves us with our original Image with no background, therefor it has a transparent background. The reason we had to copy the Mask down first is because since we did not copy the black from our Image, it will appear "watered-down". The Mask mearly adds the orginal backness back to the image, without having a background.
Code:'Copy down the Mask BitBlt BACK.hDC, 0, 0, 30, 30, picMask.hDC, 0, 0, SRCAND 'Copy down the Sprite BitBlt BACK.hDC, 0, 0, 30, 30, picSprite.hDC, 0, 0, SRCPAINT




Reply With Quote