# VB6 Transparent picture boxes.



## weedave (Jan 31, 2010)

Okay this is a very common problem for VB6 and as of yet most of the code I have tried to implement has failed =[

I have multiple picture boxes with different images being loaded in them and after I load each one in I want it to loose the white background because its all that is really holding my game back.

My game is a platform zombie shooter, I have included a couple screen shots for you to see the layout ect.

Thanks guy.
Dont hesitate to ask questions, sorry for being vague I think its obv hat i want and im in a hurry.


----------



## SUNUSI (Mar 12, 2010)

You don't make Transparent picture boxes in VB6, rather you have to use two images in each picture box. You then merge the two images using bit block transfer.
First you have to create a mask picture of your image, you do this by making the whole picture (except the background) black.
Secondly you create a sprite image which is your main picture.
Finally you then merge the two as mentioned above.
Email me if you need detail at : [email protected]


----------



## -Fabez- (Jul 28, 2008)

Is there any reason you are using Visual Basic 6 ? It is outdated and you may get better results from using a newer version, such as Visual Basic.Net or Visual Basic 2010 (Beta).


----------



## weedave (Jan 31, 2010)

-Fabez- said:


> Is there any reason you are using Visual Basic 6 ? It is outdated and you may get better results from using a newer version, such as Visual Basic.Net or Visual Basic 2010 (Beta).


It is a school project and the school only has vb6. I would use something else and I have a beta for the new one, hopefully.


----------



## weedave (Jan 31, 2010)

How efficient is masking? like will it add a lot of lag to my program or that?

I have some sort of pixel removal code but it doesn't work very well and i have a copy of a program that uses masking so i might have to go with that, the only problem is i have 50+ images but if it works then its worth it.

Thanks


----------



## -Fabez- (Jul 28, 2008)

What format are your images in ? Pixel masking can be very efficient, depending on the way you do it.


----------



## weedave (Jan 31, 2010)

At the moment they are in .GIF but I made them in photoshop so it is easy to change them.
Alot of the images are just mirror of each other tbh.

Do u have an example program that uses "efficient" image masking?


----------



## -Fabez- (Jul 28, 2008)

Most code I could provide will not work for you as the language has changed from Visual Basic 6 to .Net, however Visual Basic is capable of using transparency from the images it uses. Have you saved your images with transparent canvas's ?


----------



## weedave (Jan 31, 2010)

yeah the images are transparent, the only thing stopping them is vb6. =/


----------

