|
-
Dec 31st, 2011, 12:54 PM
#1
Thread Starter
Lively Member
[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?
-
Dec 31st, 2011, 01:22 PM
#2
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
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Dec 31st, 2011, 04:10 PM
#3
Fanatic Member
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.
-
Dec 31st, 2011, 04:20 PM
#4
Re: Picturebox transparency problem
 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
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Dec 31st, 2011, 04:38 PM
#5
Fanatic Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|