Jump to content
  • Advertisement


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


DIBs and MASKS...

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

Hi all, As part of the editor for my game, I am allowing the user to load in bitmaps that get compiled into a game file. So, I am using the windows api commands to bitblt these preview images onto a window. Works fine. But now, I want to include a background bitmap on the back of the window, for puposes of letting the user align some of the bitmaps he/she imports. The problem is, of course, that most primitive of graphical problems that we all face the first time we turn on a computer-- the square bitmap. That''s right-- when I bitblt, I get a square around my image. So my problem is, how do I do mask blitting using the windows API? I''m familiar with using XOR and OR to turn a mask+bitmap into a transparent bitmap, and I also know about the MaskBlt windows API command... but I can''t expect my users to provide a mask with every bitmap they import. Does anyone know how I could take a DIB, and copy it into a mask? I''ve already been able to duplicate it as a monochrome bitmap, and use that as a mask. The problem is, I only want the color white (255,255,255) to be transparent. When I convert it to a monochrome bitmap, it moves colors to their best match, which gives me a mask with holes in it. I''ve been fiddling around with setting the DIB bits, but I''m terrible with the windows API. Can anyone help? To review: I have a bitmap, already in a handle (HBITMAP hbm) I want to turn it into a monochrome mask with the color 255,255,255 as transparent. Please help!!!!! -- Goodlife ----------------------------- Think of your mind as a door on a house. Leave the door always closed, and it's not a house, it's a prison. Leave the door always open, and it's not a house, it's a wilderness-- all the vermin creep in.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!