>
> How do I do a bitmap so that when it draws, it wouldn't paint a
> specific color -- giving it a bitmap transparency. If you guys
> still don't get what I'm saying, I've attached a gif image with
> this email.
>
An easy way to do what you want would be the TransparentBlt
function. It's not defined in the dev-c++ headers/libraries AFAIK,
but you can still use it (i'm using it myself):
The following would draw a 100x100 bitmap onto another, using
the color you mentioned as transparent:
TransparentBlt(hdc, 0, 0, 100, 100, bitmapdc, 0, 0, 100, 100,
RGB(255, 0, 255));
Because dev-c++ has no library for it, you have to add the DLL
containing the function to the linker options (I updated to the
current mingw version, so i'm not sure this works for you). For
me it is c:/windows/system/msimg32.dll.
I attached some example code which works for me, and the makefile
I'm using to compile it.
MSDN also says this about the above function:
Windows 95/98: TransparentBlt contains a memory leak that can exhaust system resources. To draw a transparent bitmap using BitBlt, see Knowledge Base article Q79212.
I looked at that article, but I don't understand it..
--
Elias Pschernig
|