First of all, what does it mean, "transparent image"? If only makes sense if you have some graphics "below the image" (in Z order), and, if your image is semi-transparent, you can see the background graphics through. If you put your image, say, on uniform white or black background, you cannot say if it is semi-transparent or not.
But, with
PictureBox
, it may make no sense. It has only one image. To ask about transparency, you need to explain how it should be manifested. There is no transparency per se.
If this is understood, let's see how you can have the effect of transparency. If would suggest to forget about
PictureBox
, as something distracting from the essence of the problem and totally useless in practice.
To understand why you should forget about
PictureBox
, please see my past answers:
Append a picture within picturebox[
^],
draw a rectangle in C#[
^],
How do I clear a panel from old drawing[
^].
These answers also explain what could you do instead. You need to render the image on some control using
System.Drawing.Graphics
. You can, for example, draw some graphics, and, on top of it, draw some image:
http://msdn.microsoft.com/en-us/library/system.drawing.graphics.drawimage.aspx[
^].
In general case, some images support transparency. For example, you can draw a PNG image and load if from a file or some other stream:
http://en.wikipedia.org/wiki/Portable_Network_Graphics#Transparency_of_image[
^].
If you draw such kind of image over some graphics, you can see parts or all of this graphics through your image, depending on its transparency map.
Moreover, you can draw any other graphical elements (lines, rectangles and so on) with transparent properties if you simply use the colors with alpha-channel representing transparency. Please see:
http://msdn.microsoft.com/en-us/library/system.drawing.color.fromargb.aspx[
^].
In the term "ARGB", "A" mean alpha-channel, opacity:
http://msdn.microsoft.com/en-us/library/system.drawing.color.a.aspx[
^].
—SA