zoukankan      html  css  js  c++  java
  • Word截图PNG,并压缩图片大小

    static void Main(string[] args)
            {
                var iso = new ImageSaveOptions(SaveFormat.Png);
                iso.PrettyFormat = true;
                iso.UseHighQualityRendering = true;
                iso.ImageColorMode=ImageColorMode.None;
                //不能使用这个代码,因为会造成图片快速增大
                //iso.UseAntiAliasing = true;
                var doc = new Document(@"c:/doc/母亲的心.doc");
                for (int i = 0; i < doc.PageCount; i++)
                {
                    iso.PageIndex = i;
                    Stream stream = new MemoryStream();
                    doc.Save(stream, iso);
    
                    Bitmap image = new Bitmap(stream);
                    image.MakeTransparent(Color.White);
                    image.Save("C:/test" + i + ".png",ImageFormat.Png);
                    image.Dispose();
                    stream.Dispose();
                }
            }
  • 相关阅读:
    502 bad gateway错误的网关
    nodejs发展
    edgejs
    websocket nodejs实例
    nodejs原码
    node案例
    node 与php整合
    node c#
    jquery
    express
  • 原文地址:https://www.cnblogs.com/littlehb/p/3672537.html
Copyright © 2011-2022 走看看