How to make Image box transparent? 
Author Message
 How to make Image box transparent?

Ref VB6

I'm trying to find how to make my image box transparent. I have image1
control on my form and I load an image which is white background and need to
make it transparent, which my form background is black.

An example would be great!

Any help is surely appreciated.

Thanks,
jt



Sat, 07 Jun 2003 10:03:07 GMT  
 How to make Image box transparent?

Quote:
> I'm trying to find how to make my image box transparent. I have image1
> control on my form and I load an image which is white background and need
to
> make it transparent, which my form background is black.

Do you specifically need the image control there?  If not then you can
perform a masked blit.  First draw the black and white mask using the
vbSrcAnd ROP, then your image over the top using the vbSrcInvert ROP making
sure that the area's that you have masked out are black on the image.
Drawing is performed using the BitBlt() API call (I think PaintPicture()
will do the same though although slightly slower)
Hope this helps,

    Mike

 -- EDais --

WWW: Http://Members.xoom.com/EDais/




Sat, 07 Jun 2003 12:10:47 GMT  
 How to make Image box transparent?
Hi Mike,

The reason I am using an image box, is because a picture box doesn't have a
stretch property. Since I am loading an image that is larger than what I
need, I chose the image control because I can resize the loaded graphics
image.

I am assuming then your reply below can only work if using a picture box
instead.

Thanks,
jt



Quote:
> > I'm trying to find how to make my image box transparent. I have image1
> > control on my form and I load an image which is white background and
need
> to
> > make it transparent, which my form background is black.

> Do you specifically need the image control there?  If not then you can
> perform a masked blit.  First draw the black and white mask using the
> vbSrcAnd ROP, then your image over the top using the vbSrcInvert ROP
making
> sure that the area's that you have masked out are black on the image.
> Drawing is performed using the BitBlt() API call (I think PaintPicture()
> will do the same though although slightly slower)
> Hope this helps,

>     Mike

>  -- EDais --

> WWW: Http://Members.xoom.com/EDais/





Sat, 07 Jun 2003 15:01:51 GMT  
 How to make Image box transparent?

Quote:
> The reason I am using an image box, is because a picture box doesn't have
a
> stretch property. Since I am loading an image that is larger than what I
> need, I chose the image control because I can resize the loaded graphics
> image.

> I am assuming then your reply below can only work if using a picture box
> instead.

No, it blits directly on the parent object, the form or a picture box,
whichever you prefer.  You can perform a masked and stretched blit with the
StretchBlt() API call if that's what your after, again PaintPicture() will
do the same if your looking for a non-API solution.
Hope this helps,

    Mike

 -- EDais --

WWW: Http://Members.xoom.com/EDais/




Sat, 07 Jun 2003 15:29:37 GMT  
 How to make Image box transparent?
Hi Mike,

Do you have an example of this by any chance?

Thanks again,
jt



Quote:
> > The reason I am using an image box, is because a picture box doesn't
have
> a
> > stretch property. Since I am loading an image that is larger than what I
> > need, I chose the image control because I can resize the loaded graphics
> > image.

> > I am assuming then your reply below can only work if using a picture box
> > instead.

> No, it blits directly on the parent object, the form or a picture box,
> whichever you prefer.  You can perform a masked and stretched blit with
the
> StretchBlt() API call if that's what your after, again PaintPicture() will
> do the same if your looking for a non-API solution.
> Hope this helps,

>     Mike

>  -- EDais --

> WWW: Http://Members.xoom.com/EDais/





Sun, 08 Jun 2003 07:20:33 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Making an image transparent...

2. Making Image white space transparent

3. Making an image transparent...

4. ***Image Backgroup Made Transparent***

5. Help, I having trouble making this image transparent?

6. Making Radio Buttons, check boxes , and Frames Transparent

7. Making a picture box transparent

8. picture box: can it be made transparent?

9. can a text box be made transparent?

10. overlaying a transparent image onto a picture box

11. Current mouse cursor in transparent image box

12. Transparent image boxes

 

 
Powered by phpBB® Forum Software