views:

342

answers:

2

I'm trying to use the GDI MaskBlt command to draw an image with transparency: http://msdn.microsoft.com/en-us/library/dd145047(VS.85).aspx

I can't seem to find anything in the documentation about what raster operator to use for the obvious use case: a sort of MAKEROP4(SRCCOPY, DSTCOPY) - blitting where the mask is 1, and leaving the destination untouched where the mask is 0. SRCCOPY is a valid ROP, but what should I use in place of my fictional DSTCOPY ?

+2  A: 

The MSDN page "Ternary Raster Operations" explains that the correct value is 0x00AA0029.

andygeers
A useful link for computing ROP codes without having to decipher RPN: http://www.kkow.net/etep/docs/rop.html
Rob Kennedy
A: 

Avoid MaskBlt and use transparency Win32 apis.

Care to share why?
andygeers