Transparent Background of a picture

ToniMontana

Active member
Joined
Feb 23, 2004
Messages
29
Location
Munich, Germany
Hi,

does anybody know how I can make a pictureBox
in a form, which has a picture with a transparent
background?

I know from programs for picture-processing that it
is possible to define a backgroundcolor, which should
define the transparent parts of the picture, but how
can I do this in .NET ?

Toni.
 
Maybe setting the ControlStyle can help you further!? It has a flag SupportsTransparentBackColor... see MSDN for more information...
 
Bitmap objects have a MakeTransparent method that you pass a color. It results in every pixel that is that color being transparent...

[VB]
Dim bmp as new Bitmap("C:\testImage.bmp")
bmp.MakeTransparent(Color.Cyan)
PictureBox1.Image = bmp
[/VB]
 
Back
Top