Bitmap b = new Bitmap(@"D:\as.jpg");
b.MakeTransparent(System.Drawing.Color.White);
b.Save("d:\\haha.jpg");
添加:
using System.Drawing;
wpf需要添加引用System.Drawing.dll。
上面实例就是把图片中的白色变为透明色。
Bitmap b = new Bitmap(@"D:\as.jpg");
b.MakeTransparent(System.Drawing.Color.White);
b.Save("d:\\haha.jpg");
添加:
using System.Drawing;
wpf需要添加引用System.Drawing.dll。
上面实例就是把图片中的白色变为透明色。
转载于:https://www.cnblogs.com/fornet/archive/2013/03/09/2976181.html