[RESOLVED] Picturebox transparency problem
Hello,
I have multiple picturebox controls in my form.
Both of them contain an image with a transparent background.
I want them to be on top of each other.
I've already set their BackColor property to Transparent, but when I place one on top of the other one, the following happens: http://tinypic.com/view.php?pic=2v284s0&s=5
How can I make them transparent while they are on top of each other?
Re: Picturebox transparency problem
pictureboxes don't support transparent backgrounds.
you need to draw the top image onto the bottom image + display the resulting image in 1 picturebox
Re: Picturebox transparency problem
I usually use the BackgroundImage property instead of the Image property.
It seems like the BackgroundImage one supports/allows transparency.
The image needs to be in a format which supports transparency though, such as PNG (which I always use) or perhaps GIF.
Re: Picturebox transparency problem
Quote:
Originally Posted by
Zeelia
I usually use the BackgroundImage property instead of the Image property.
It seems like the BackgroundImage one supports/allows transparency.
The image needs to be in a format which supports transparency though, such as PNG (which I always use) or perhaps GIF.
i think you mean overlay 1 picture on the other in 1 picturebox, using the backgroundimage + the image properties
Re: Picturebox transparency problem
Actually I don't mean that.
Just pass the image you want to use to the BackgroundImage property instead of Image.
I don't know why, but it works. Must be some flaw in the PictureBox control.
I could be mistaken though since it was some time ago when I worked with an application with custom UI, but I believe it worked. If it doesn't, there sure are other ways to workaround the PictureBoxs' limitations, just as you wrote, Paul.