我想在 WPF VS2008 中制作一个半透明的 UI,因此我将表单设为透明,并想在其顶部显示一个半透明 png(其中包括“孔”)。
如何显示半透明png?
半透明,意味着它有可以看到的孔。
另外,我如何在 C# 中完成此操作,而不使用 WPF。
Thanks.
您只需使用 Image 控件,WPF 就会处理其余的事情:
<Image Source="myimage.png" />
或者在纯 C# 中:
BitmapImage sourceImage = new BitmapImage();
sourceImage.BeginInit();
sourceImage.UriSource = new Uri("myimage.png", UriKind.RelativeOrAbsolute);
sourceImage.EndInit();
Image myImage = new Image();
myImage.Source = sourceImage;
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)