Jump to content
  • Advertisement
Sign in to follow this  
Peter Conn

TransparentBlt not working

This topic is 4607 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hiya I have bought a bokk called "Sam Teach Yourself Game Programming in 24 hours". I have been trying to make a simple game that moves a sprite around the screen, so far I have managed to make the sprite and background appear, modifying the game Henway from the book. The first time I tried to run I had loads of linking problesms with the objects, I sorted this out by removing all the lines that involved joystick functions, and a few involving bitmap drawing. Now I can run the program but unfortunatly it still shows any magenta (rgb(255,0,255)) parts I have put in the pictures even though they shouldn't be drawn. I have traced this to the function: void Bitmap::Draw(HDC hDC, int x, int y, BOOL bTrans, COLORREF crTransColor) { if (m_hBitmap != NULL) { // Create a memory device context for the bitmap HDC hMemDC = CreateCompatibleDC(hDC); // Select the bitmap into the device context HBITMAP hOldBitmap = (HBITMAP)SelectObject(hMemDC, m_hBitmap); // Draw the bitmap to the destination device context // 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); // Restore and delete the memory device context SelectObject(hMemDC, hOldBitmap); DeleteDC(hMemDC); } } I cannot run the program without commenting out the lines otherwise it will come up with: Bitmap.obj : error LNK2001: unresolved external symbol __imp__TransparentBlt@44 Debug/Movement Feature.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. I am currently using MS Visual C++ 6, can someone please tell me how to make this work?

Share this post


Link to post
Share on other sites
Advertisement
I don't really know much about libruaries, although I know how to link to them, is there a way to tell which libruary you need to link to to make a certain function work?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!