Mono Ignores Graphics.InterpolationMode?

旧城冷巷雨未停 提交于 2019-12-11 09:58:24

问题


I have a program that draws some vector graphics using System.Drawing and the Graphics class. The anti-aliasing works, kindof okay, but for my need I neede oversampling, so I create the starting image to be n times larger and then scale back the final image by n. On Window and .NET the resulting image looks great! However, on Mono 2.4.2.3 (Ubuntu 9.10 stock install), the intropolation is horrible. Here's how I'm scaling my images:

Bitmap bmp = new Bitmap(Bmp.Width / OverSampling, Bmp.Height / OverSampling);
Graphics g = Graphics.FromImage(bmp);
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.DrawImage(Bmp, 0, 0, bmp.Width, bmp.Height);
g.Dispose();

From what I can tell there is no interpolation happening at all. Any ideas?


回答1:


Well I found this: http://www.mail-archive.com/mono-devel-list@lists.ximian.com/msg18099.html

I guess the underlying code of Mono's drawing routines are at fault. YAY! Now I get to write my own downscaler.




回答2:


See:

  • High quality image re-sampling in Mono/C#/ASP.NET
  • http://www.toptensoftware.com/blog/posts/17/high-quality-image-resampling-in-monolinux


来源:https://stackoverflow.com/questions/2685084/mono-ignores-graphics-interpolationmode

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!