Mono 忽略 Graphics.InterpolationMode?
我有一个程序使用 System.Drawing 和 Graphics 类绘制一些矢量图形。抗锯齿工作正常,但根据我的需要,我需要过采样,因此我将起始图像创建为大 n 倍,然后将最终图像缩小 n 倍。在 Window 和 .NET 上,生成的图像看起来很棒!然而,在 Mono 2.4.2.3(Ubuntu 9.10 原生安装)上,内插是可怕的。以下是我缩放图像的方式:
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();
据我所知,根本没有发生插值。有什么想法吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,我发现了这个: http://www .mail-archive.com/[email protected]/msg18099.html
我猜Mono绘图例程的底层代码是在过错。耶!现在我开始编写自己的缩减器。
Well I found this: http://www.mail-archive.com/[email protected]/msg18099.html
I guess the underlying code of Mono's drawing routines are at fault. YAY! Now I get to write my own downscaler.
请参阅:
See: