新网创想网站建设,新征程启航

为企业提供网站建设、域名注册、服务器等服务

.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图片画质代码
当前网址:http://www.wjwzjz.com/article/ipooci.html
在线咨询
服务热线
服务热线:028-86922220
TOP