Computer Science Canada Picture box--picture transparancy |
Author: | zwnage [ Sat Jan 20, 2007 4:30 pm ] |
Post subject: | Picture box--picture transparancy |
Hello. I want to put a few pictures of ball like objects into my game, and I guess I'm going to need to put them into picture boxes. Unfortunately, my picture of the ball is in an rectangle shaped frame (as almost all pictures are). If I would put one of these pictures into my picture box, I am going to assume that the rectangle border would cover up any pictures in the background (havent tried it yet, but I would like to know if there is a fix to my question before I start putting the pictures in). So my question is: Can I set certain colors in the boxes to be transparent, make the picture box circular, make the imported picture circular, or something like that so the rectangle border doesn't cover my background? |
Author: | Monstrosity_ [ Sat Jan 20, 2007 6:31 pm ] |
Post subject: | Re: Picture box--picture transparancy |
zwnage @ Sat Jan 20, 2007 5:30 pm wrote: So my question is: Can I set certain colors in the boxes to be transparent, make the picture box circular, make the imported picture circular, or something like that so the rectangle border doesn't cover my background?
Not quite. You CAN accomplish this with just picture boxes, but it follows the same method as bitblt masking. So your best bet would look up some vb bitblt mask tutorials like this one. Or if you COULD make your own draw function that draws pixel by pixel, only those you want ;p .. this would run slower but fun to make. Now that you read that, you could also use gifs with transparency and the image control. |
Author: | zwnage [ Sat Jan 20, 2007 10:52 pm ] |
Post subject: | RE:Picture box--picture transparancy |
Thanks for the help. I used the gif with transparency method and it's working great. |