单声道会忽略Graphics.InterpolationMode吗? [英] Mono Ignores Graphics.InterpolationMode?

查看:92
本文介绍了单声道会忽略Graphics.InterpolationMode吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用System.Drawing和Graphics类绘制一些矢量图形的程序.抗锯齿效果很好,但是出于我的需要,我需要过采样,因此我将起始图像创建为大n倍,然后将最终图像按n缩小.在Window和.NET上,生成的图像看起来很棒!但是,在Mono 2.4.2.3(Ubuntu 9.10库存安装)上,这种内插是可怕的.这是缩放图片的方式:

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?

推荐答案

好,我发现了这一点:

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

我想Mono的绘制例程的底层代码有问题.耶!现在,我要编写自己的缩减程序.

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

这篇关于单声道会忽略Graphics.InterpolationMode吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆