Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# VB graphics
I'm working on a UserControl which has two PictureBoxes.
One has the picture I want to display to the user and the other has a picture that I use as an overlay.
 
The overlay PictureBox uses a PNG image with a transparent background. However, every time I run the UserControl, the overlay does not display the transparent parts of the PNG image as transparent (It appears white).
 
I've tried modifying the BackGroundColor and all other tricks up my sleeve but nothing is working.
 
Can anyone help me?
Posted 14-Jan-10 7:06am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

This link[^] should be helpful. It basically says to derrive a new class from the control (PictureBox in this case) and override the OnPaintBackground method to do nothing.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Does changing the picturebox opacity property to something less 100% help?
 
My bad. I thought you could set the opacity for controls. You can only do that for Form objects. You will have to make a custom control to achieve your result.
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

I do not know which language or IDE you are talking about but there is nothing like an Opacity property for PictureBoxes when programming in Visual Studio 2008 using VB.NET or C#.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

you can try adding it to the parent first so,
picturebox2.parent = picturebox1.image
and then add opacity property
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web04 | 2.8.140926.1 | Last Updated 18 Aug 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100