PerPixelAlphaForm transparentImageForm = new PerPixelAlphaForm();
transparentImageForm.SetBitmap(<IMAGE GOES HERE>,<OPACITY GOES HERE>);
//opacity是图像绘制时使用的不透明度,值为255表示所有透明部分将与原始PNG等一样具有alpha/透明度。
编辑:或者转向WPF。
是的,System.Drawing.Image.FromFile("filename.png"); .NET框架支持多种文件类型的透明度,我认为它不适用于JPEG,但对于PNG应该没有问题。
WPF: http://msdn.microsoft.com/en-us/library/aa970062.aspx
Windows: http://msdn.microsoft.com/en-us/library/stf701f5.aspx
关于 System.Drawing.Image.FromFile 方法: