Archived

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

Visual Basic - Picture mask

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

I want to take an image or a picture box and take away the background color. Surprisingly the command button has a mask color property in which you can select a color to be masked but I want to do the same in a picture box or even better.. an image -unless someeone also has a way of making a picture stretch to the size of the picture box control like what you can do by images. by the way this is all in VB6 Thank you in advance,

Share this post


Link to post
Share on other sites
To do anything fancy in VB with graphics, you will want to use the WIN32 api or DirectX.
If what you want to do is mask out bitmaps that get painted on to the screen(like for 2d animation), you need to create a picture box that will be your display area (think of picture boxes as windows, there is no making them transparent or irregular) and ''blit'' the bitmaps into it. You can use VB''s paintpicture method if you don''t like winapi but it is slower. regardless, you must paint two images, using different bit operatives (SRCAND then SRCPAINT - ithink) - First paint the black and white masked image, then paint the real mcoy. you can use the stretch variation to make the bitmap bigger or smaller. hope this helps.

Share this post


Link to post
Share on other sites