Bitmap bt = Image.FromFile("c:\a.gif");
Bitmap gifBt = new Bitmap(bt.Width,bt.Height);
Graphics gifGra = Graphics.FromImage(gifBt);
gifGra.Clear(ColorTranslator.FromHtml("#00FF00"));
gifGra.DrawImage(bt,new Rectangle(0,0,gifBt.Width,gifBt.Height),0,0,bt.Width,bt.Height,GraphicsUnit.Pixel);
string gifFile = Server.MapPath(Constant.LocalTmp + saveFileName + ".gif") ;
gifBt.Save(gifFile,System.Drawing.Imaging.ImageFormat.Gif);
gifBt.Dispose();
把 “00FF00” 就透明 。。。
不过做完总会有一些锯齿。。
锐
|
园豆:205
(菜鸟二级)
|
2008-02-20 17:37