views:

442

answers:

1

Hi,

I want make a UI that is semi transparent in WPF VS2008, so I made my form transparent and I want to show a semi transparent png (Which includes "holes") on top of it. How do I show the semi transparent png?

Semi transparent, meaning it has holes you can see through.

Also how can I get this done in C#, without using WPF.

Thanks.

+4  A: 

You should just have to use the Image control and WPF should take care of the rest:

<Image Source="myimage.png" />

Or in pure C#:

BitmapImage sourceImage = new BitmapImage();
sourceImage.BeginInit();
sourceImage.UriSource = new Uri("myimage.png", UriKind.RelativeOrAbsolute);
sourceImage.EndInit();

Image myImage = new Image();
myImage.Source = sourceImage;
Drew Marsh
hhh, yeah it works.., kinda of a stupid question...I wonder how you can get this done in C#.
Haim Bender
Added C# example too. :)
Drew Marsh
I want the UI to be transparent, so do I just make a transparent form (HOW?) and put the image on top?Thanks mate.
Haim Bender
I answered how to make Windows transparent in WPF in this StackOverflow question (vote it up if it helps you): http://stackoverflow.com/questions/1541837/how-do-i-make-my-form-transparent-but-what-i-draw-on-it-not
Drew Marsh