Transparent png using wpf in VS2008
I want to create UI 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 to show translucent png?
Semi-transparent, meaning it has holes that you can see.
Also how can I do this in C # without using WPF.
Thank.
+2
source to share
1 answer
You just need 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;
+4
source to share