I'm trying to use the TransparentBlt() function to create a transparent color in a bitmap of my game, but i'm having some trouble.
The book i'm reading says that I need to make sure my compiler is linked to a library file called msimg32.lib. The book offers instructions on how to do this linking with VCpp, but I use Dev-Cpp (why in a minute) and I can't quite seem to figure it out.
This is the portion of the code giving me trouble:
if (bTrans)
TransparentBlt(hDC, x, y, GetWidth(), GetHeight(), hMemDC, 0, 0, GetWidth(), GetHeight(), crTransColor);
else
BitBlt(hDC, x, y, GetWidth(), GetHeight(), hMemDC, 0, 0, SRCCOPY);
And this is the error:
Bitmap.cpp:225: error: `TransparentBlt' undeclared (first use this function)
Bitmap.cpp:225: error: (Each undeclared identifier is reported only once for each function it appears in.)
make.exe: *** [Bitmap.o] Error 1
Execution terminated
Just in case, if anybody else has read the same book to offer better advice, the book is
SAMS Teach Yourself Game Programming in 24 Hours. I don't really care what your opinion on the book is - but this code is from Hour 6, and the program is the first UFO program dealing with mouse and keyboard input.
I have tried opening the project with VCpp but that ends up being a lot worse. Even though i'm able to follow the book's instructions and include the proper .lib file, I get a ton more compiler erros - things about not being able to open winnt.h and bad pragmas and such. It's really terrible. FYI, It's VCpp Express 2005.