-1

Hey I'm a beginning programmer and I have to do a big school project. The problem I'm having is I have a picture of a roadsign, now the file itself is a png and it is transparent (I checked in photoshop). Now when I put this image in my panel it has a white background. While it's transparent in photoshop. I don't want the white background because I think it's ugly and also a little bit sloppy. The image is loaded in the right window where you can see all your properties. I tried:

panel.Backcolor = Color.Transparent ; // 1

panel.Backcolor = Color.getFromArgb(0,0,0,0); // 2

EDIT1:
I work with .

EDIT2:

this.startPanel1.BackgroundImage = global::DragnDrop.Properties.Resources.BeladenToestanf;
Dmitry
  • 13,797
  • 6
  • 32
  • 48
vsp33ddyv
  • 23
  • 1
  • 9
  • Are you sure that the file was exported from Photoshop with transparency turned on? – Andrew May 02 '14 at 21:21
  • Yes , I'm 100% sure, when I look at the picture with a photoviewer I can Clearly see that the picture is transparent, but when I load it in VB in my panel it's not transparent anymore. Also I work a lot with photoshop and in photoshop I'm not a noob ;) – vsp33ddyv May 02 '14 at 21:27
  • Can you post the code where you are loading the image and inserting it into the panel? – Andrew May 02 '14 at 21:28
  • WinForms controls don't really support transparency – SLaks May 02 '14 at 21:28
  • I am using a drag and drop on my picture, but I just need to know if I can make my image transparent ;) It's just a design issue that's all ;) – vsp33ddyv May 02 '14 at 21:34

1 Answers1

0

It's been a while since I used WinForms, but you might be able to get away with loading your picture into a PictureBox control.

Winforms semi-transparent PNG over semi-transparent PNG

Community
  • 1
  • 1
Andrew
  • 4,953
  • 15
  • 40
  • 58
  • This is the answer to my problem , Thanks ;) unfortunatly I may not use a picturebox, I need to use a panel from my professor. But then I'll need to live with this problem. It's only a design issue ;) – vsp33ddyv May 02 '14 at 21:37