how can I make picturebox where background would be transparent? for transparent .PNG image?
Thanks!
how can I make picturebox where background would be transparent? for transparent .PNG image?
Thanks!
Last edited by Hece; Feb 19th, 2012 at 03:44 AM.
Which programming language, and version, are you using?
Insomnia is just a byproduct of, "It can't be done"
Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum. Read the HitchHiker's Guide to Getting Help on the Forums.
Here is the list of TAGs you can use to format your posts
{Alpha Image Control} {Memory Leak FAQ} {GDI+ Classes/Samples} {Unicode Open/Save Dialog} {Icon Organizer/Extractor}
{VBA Control Arrays} {XP/Vista Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}
Visual Basic Express Edition 2008
Just set the picture box's BackColor to Color.Transparent. You can do it in the designer or in code. Then you can put your transparent PNG in the BackgroundImage or the Image of the picture box.
But remember, transparency in Windows Forms is a bit limited. You can only see through to the parent of the picture box, which is normally the form. So if you put a transparent picture box on top of a button, for example, the button will not show. What you can see through the transparent parts is the form's BackColor and/or its BackgroundImage.
BB
Last edited by boops boops; Feb 20th, 2012 at 10:05 AM.
Code bank stuff:
Rapid pixel processing with FastPix (LockBits wrapper)
Slide show with cross-fading
Three Dimensional Text in GDI+
Pangram Tester
Extended OpenFileDialog -- opens in Thumbnail View etc.
ZoomPictureBox: 3 zooming modes and mouse drag
"Shaped Form" with soft drop shadow, translucent colours -- using WPF!
ah, okay. Thanks!