【问题标题】:Magicknet Get and SET image resolution (PPI)Magicknet 获取和设置图像分辨率 (PPI)
【发布时间】:2013-01-10 13:02:27
【问题描述】:

我在我的 ASP.NET 项目中使用 Magicknet 进行图像处理。如何获取和设置图像的图像分辨率? - 当我调整 300 像素/英寸的图像大小时,默认情况下它显然会生成 72 像素/英寸的图像,并且因为我保持相同的尺寸,所以我得到的图像质量非常低。所以我需要能够保持图像的ppi。

我还想补充一点,这可能会导致 magicknet 或 System.Drawing.Image,但我不能 100% 确定。

我正在使用的代码:

    img.ModulusDepth = 10;   
    img.Compression = CompressionType.JPEGCompression;
    img.Quality = 80;


    string optimizedImage = System.Web.HttpContext.Current.Server.MapPath(".") + "\\temp\\" + Guid.NewGuid().ToString() + ".jpg";
    img.Write(optimizedImage); // save optimized image as temp file

    Magick.Term();

    System.Drawing.Image tempimage = System.Drawing.Image.FromFile(optimizedImage);  // load the optimized image into an image objec

I've read here 开始,默认值为每英寸 72 像素。

谢谢

【问题讨论】:

    标签: c# asp.net image-processing imagemagick magicknet


    【解决方案1】:

    图像 DPI 在网络环境中是完全不相关的;这是所有浏览器和几乎所有打印机都忽略的元数据设置。

    像素是您必须使用的单位; DPI 是每个库和 UI 以不同方式处理的泄漏抽象。

    您可能会also consider using a server-safe alternative to Magicknet

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-04-09
      • 2012-11-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多