.net中使用GDI+提高gif图片画质代码-古蔺大橙子建站
RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
.net中使用GDI+提高gif图片画质代码

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

    使用octreequantizer很方便:

成都创新互联公司是一家专业提供申扎企业网站建设,专注与网站设计、网站制作H5网站设计、小程序制作等业务。10年已为申扎众多企业、政府机构等服务。创新互联专业网站建设公司优惠进行中。

隐藏行号 复制代码 ?代码
  1.  system.drawing.bitmap b = newSystem.Drawing.Bitmap("c:\original_image.gif");  
    
  2. System.Drawing.Imagethmbnail = b.GetThumbnailImage(100,75,null,newIntPtr()); 
    
  3. OctreeQuantizer quantizer = newOctreeQuantizer ( 255 , 8 ) ; 
    
  4. using( Bitmapquantized = quantizer.Quantize ( thmbnail ) ) 
    
  5. { 
    
  6.      quantized.Save("c:\thumnail.gif", System.Drawing.Imaging.ImageFormat.Gif); 
    
  7. } 
    
  8. octreequantizer grayquantizer = newGrayscaleQuantizer ( ) ; 
    
  9. using( Bitmapquantized = grayquantizer.Quantize ( thmbnail ) ) 
    
  10. { 
    
  11.      quantized.Save("c:\thumnail.gif", System.Drawing.Imaging.ImageFormat.Gif); 
    
  12. } 
    

网页名称:.net中使用GDI+提高gif图片画质代码
URL链接:http://scgulin.cn/article/ipooci.html