All articles(网络文学目录) All Pictures(图片目录) All Softwares(软件目录)

 
.Net中使用GDI+提高gif图片画质的代码_[Asp.Net教程]

Writer: delv Article type: Programming skills(编程技巧) Time: 2014/1/24 9:02:16 Browse times: 349 Comment times: 0

.Net中使用GDI+提高gif图片画质的代码_[Asp.Net教程]


Head photo

Go homepage
Upload pictures
Write articles

.Net中使用GDI+提高gif图片画质的代码_[Asp.Net教程]

  在.net中使用GDI+来提高gif图片画质,这就是“Octree” 算法。“Octree”算法允许我们插入自己的算法来量子化我们的图像。

  使用octreequantizer很方便:

system.drawing.bitmap b = new System.Drawing.Bitmap(“c:\original_image.gif“);
  System.Drawing.Image thmbnail = b.GetThumbnailImage(100,75,null,new IntPtr());
  OctreeQuantizer quantizer = new OctreeQuantizer ( 255 , 8 ) ;
  using ( Bitmap quantized = quantizer.Quantize ( thmbnail ) )
  {
  quantized.Save(“c:\thumnail.gif“, System.Drawing.Imaging.ImageFormat.Gif);
  }
  octreequantizer grayquantizer = new GrayscaleQuantizer ( ) ;
  using ( Bitmap quantized = grayquantizer.Quantize ( thmbnail ) )
  {
  quantized.Save(“c:\thumnail.gif“, System.Drawing.Imaging.ImageFormat.Gif);
  }

  主要代码就这么多,是不是很简单呢?

本文由设计家园 收集整理





There are 0 records,
Comment:
Must be registered users to comment(必须是注册用户才能发表评论)

Disclaimer Privacy Policy About us Site Map
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.