Groups | Blog | Home
all groups > dotnet drawing api > august 2003 >

dotnet drawing api : transparent pictureboxes


ultim
8/28/2003 3:24:32 PM
hi
i want to put several pictureboxes onto each other, so i
get layers made of pictureboxes. the most part of a picbox
should be transparent, so that only the drawings occlude
the picboxes behind it, and where a picbox is transparent,
the drawings on the picboxes behind it are visible.
I already tried Control.SetStyles but it did not work.
please help!

Note that im not drawing on the picboxes, but drawing on
bitmaps through a Graphics object, and then load that
image as the background of a picbox.

Please, help me with the tranparencies since i can not get
a picbox to be transparent so that i can see the other
controls behind it.

Bob Powell [MVP]
8/29/2003 10:37:43 AM
PictureBox cannot do this. Even if you could provide a semi-transparent
image, the background would be opaque.

You could write a control to do so yourself though.

The Tips and Tricks section of my site has information on how to create a
transparent control. If you want to create a layered effect with many
images, you could create a structure with an image and a transparency and
have the control manage a collection of these, drawing each one in turn.

--
Bob Powell [MVP]
C#, System.Drawing

ANNOUNCING: Well Formed.
The monthy electronic magazine for
Windows Forms and GDI+ engineers
http://www.bobpowell.net/wellformed.htm

Check out the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm


[quoted text, click to view]

.NET coder
9/3/2003 9:44:20 AM
Or you could use a Panel instead of a PictureBox and set the panel
transparent.


[quoted text, click to view]

AddThis Social Bookmark Button