MichaelSpectre
Member
- Joined
- Feb 26, 2012
- Messages
- 11
- Location
- Visalia, California, United States
- Programming Experience
- 10+
I remember way back in my VB6 days, I wrote a module that would create a device context in memory, load and select a compatible bitmap, and create a mask for the image, given a color to be marked as "transparent" (white) in the mask.
Then all you had to do was BitBlt the mask to the target DC using the SRCAND raster operation, followed by the image using SRCPAINT to knock out any parts of the image where the mask's pixels are marked as white.
After a nostalgic moment of digging through my ancient code, I migrated and tried this in VB.NET 2010 Express using p/invoke and the standard Win32 API functions. Everything works as expected, except the SRCAND operation seems to function as SRCCOPY for some reason. I was wondering if somewhere between Win98 to Win7, this became broken or changed? Has anyone else got transparency to work in VB 2010 using the old BitBlt methods?
Then all you had to do was BitBlt the mask to the target DC using the SRCAND raster operation, followed by the image using SRCPAINT to knock out any parts of the image where the mask's pixels are marked as white.
After a nostalgic moment of digging through my ancient code, I migrated and tried this in VB.NET 2010 Express using p/invoke and the standard Win32 API functions. Everything works as expected, except the SRCAND operation seems to function as SRCCOPY for some reason. I was wondering if somewhere between Win98 to Win7, this became broken or changed? Has anyone else got transparency to work in VB 2010 using the old BitBlt methods?