
Mask used with transparent Picture Box question
I'm having some difficulty in creating a monochrome mask to be used in
creating a transparent image on a picture box.
Before I get to the question let me explain how I did manage to create a
transparent picture box......
1. I created a source PictureBox (SRC) that contains a color image with a
transparent color of pink.
2. I used the paintbrush program to convert the same image to B&W. I
changed the pink color to black and the rest to white. I saved it as a
monochrome bitmap (note: it tried saving as a color bitmap and it didn't
work).
3. Back in VB I created a mask PictureBox (MASK) and used the monochrome
bitmap as the picture property.
4. I used the Blt function to make the transparent bitmap using my SRC,
MASK, and destination PictureBox (DEST).
This worked!
Now I tried the same thing but instead of using paintbrush I did some brute
force code to convert the SRC over to the MASK (using the PSet method).
The MASK image looked exactly like the bitmap I created using paintbrush so
I thought it would work with the Blt command......WRONG!
I also setting the MASK.picture = MASK.image but that didn't work.
So, after all of that my question is:
Can I use some API's to create the monochrome image on my MASK picture box.
How do I do it. I've been trying for a while now and just can't do it. I
won't complain if you bore me with details on how to do this.
Thanks,
Sam