Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Lor

Graphics Question

This topic is 6305 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

Hey guys. I''m making a tiled RPG thingy and have a problem with transparent bitmaps. I went to a site and found a technique for doing this that bitblt''s three times, once with SRCINVERT, then SRCAND (the mask), then SRCINVERT again. The problem is that the transparent bits of the tile have a darker tinge to them. They have a tint, like the windows in limousines. Only a little but it''s noticeable. I have tried to solve the problem but come up trumps. Any ideas? PS: Here''s the code I use. //-------------------------------------------- dcMem.SelectObject(&m_bmpBitmapGrass4); // Create the mask bitmap CBitmap bitmapTrans; int nWidth = 32; int nHeight = 32; bitmapTrans.CreateBitmap(nWidth, nHeight, 1, 1, NULL); dcTrans.SelectObject(&bitmapTrans); dcMem.SetBkColor(RGB (0,0,0)); dcTrans.BitBlt(0, 0, nWidth, nHeight, &dcMem, 0, 0, SRCCOPY); dc.BitBlt(bm.bmWidth*9, bm.bmHeight*7, bm.bmWidth, bm.bmHeight, &dcMem, 0, 0, SRCINVERT); dc.BitBlt(bm.bmWidth*9, bm.bmHeight*7, bm.bmWidth, bm.bmHeight, &dcTrans, 0, 0, SRCAND); dc.BitBlt(bm.bmWidth*9, bm.bmHeight*7, bm.bmWidth, bm.bmHeight, &dcMem, 0, 0, SRCINVERT); //-----------------------------------------------------

Share this post


Link to post
Share on other sites
Advertisement
I know, I know, I really should learn direct x. I tried when I was using Visual Basic, but all the source code I looked at was very intimidating. Anyway, I intend to learn it after I complete this project. For an RPG the slowness of the GDI doesn''t really matter that much.

PS: How do you make those little faces come up in the message, oh that is the height of coolness (I don''t get out much )

Share this post


Link to post
Share on other sites

  • 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!