How do I handle multiple bitmaps in memory?
C / C++ / MFC
2
Posts
2
Posters
0
Views
1
Watching
-
I'm trying to take multiple small bitmaps, BitBlt them into a memory dc then using a mask, draw them transparently to the screen. With one bitmap from a file it works fine, but when I combine them to an in memory DC and do the transparent blt, the colors get screwed up.
-
I'm trying to take multiple small bitmaps, BitBlt them into a memory dc then using a mask, draw them transparently to the screen. With one bitmap from a file it works fine, but when I combine them to an in memory DC and do the transparent blt, the colors get screwed up.
try to use
TransparentBlt()
, it uses chroma key to apply the transparency, and much easierBOOL TransparentBlt( HDC hdcDest, // handle to destination DC int nXOriginDest, // x-coord of destination upper-left corner int nYOriginDest, // y-coord of destination upper-left corner int nWidthDest, // width of destination rectangle int hHeightDest, // height of destination rectangle HDC hdcSrc, // handle to source DC int nXOriginSrc, // x-coord of source upper-left corner int nYOriginSrc, // y-coord of source upper-left corner int nWidthSrc, // width of source rectangle int nHeightSrc, // height of source rectangle UINT crTransparent // color to make transparent );