Sign in to follow this  

Help a Noob Draw [VB6]

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

So, I'm currently learning VB6 in a class. As some of you know, VB6 doesn't take transparency well, and for my end of the year game, this is what I need. I know a way around this, using PSet for each pixel. I'm bound and determined to use this method for my game. But for future projects is there any simple way to get transparency in my picture boxes? Not using anything that you need to be fluent in VB6 for, but simplish things. Thank you. =]

Share this post


Link to post
Share on other sites
PSet is extremely slow, so be warned that you might run into speed problems if you're using it heavily.

Pictureboxes in VB6 do not support transparent backgrounds, AFAIK. However, the Image control does, and with .ICO files or .EMF files you can get a transparent background. There are also some custom OCX controls floating around with PNG and GIF support, so that might be worth looking into. If you have access to a higher-level edition of VB6 you can also try creating your own custom control, but without some experience in low-level rendering that's probably not a good choice.


The real answer though lies in learning to do graphics via something more powerful than VB6's engine. Unfortunately VB6 is kind of a hideously bad language, so I wouldn't get too tied to its quirks. You can learn the Win32 GDI API for doing graphics, which will be a skill portable to any other language on the Windows platform. GDI is pretty messy stuff, but it's fairly fast (fast enough for simple games) and not too hard to work with once you learn how to use it.

Share this post


Link to post
Share on other sites
you can also use the bitblt function in the gdi32 libary and the hdc from a picture box to draw bitmaps and then using a black and white mask and an image you can combine the two to get a tranparent image. i forgot what they were and can't play with it to figure them out since i no longer have access to vb6

Share this post


Link to post
Share on other sites
Quote:
Original post by ApochPiQ
PSet is extremely slow, so be warned that you might run into speed problems if you're using it heavily.

Pictureboxes in VB6 do not support transparent backgrounds, AFAIK. However, the Image control does, and with .ICO files or .EMF files you can get a transparent background. There are also some custom OCX controls floating around with PNG and GIF support, so that might be worth looking into. If you have access to a higher-level edition of VB6 you can also try creating your own custom control, but without some experience in low-level rendering that's probably not a good choice.


The real answer though lies in learning to do graphics via something more powerful than VB6's engine. Unfortunately VB6 is kind of a hideously bad language, so I wouldn't get too tied to its quirks. You can learn the Win32 GDI API for doing graphics, which will be a skill portable to any other language on the Windows platform. GDI is pretty messy stuff, but it's fairly fast (fast enough for simple games) and not too hard to work with once you learn how to use it.


Thank you, I'll look into all this stuff for my next project, even though I can't make sense of it. =]

Share this post


Link to post
Share on other sites

This topic is 3147 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this