【发布时间】:2013-10-03 21:17:30
【问题描述】:
目前,我正在成功使用Graphics class 绘制一个非矩形的裁剪图像(里面的乌龟):
我的代码如下所示:
using (var g = Graphics.FromImage(image))
{
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
using (var gfxPath = new GraphicsPath())
{
gfxPath.AddEllipse(r);
using (var region = new Region(r))
{
region.Exclude(gfxPath);
g.ExcludeClip(region);
g.DrawImage(turtleImage, r, r2, GraphicsUnit.Pixel);
}
}
}
这一切都按预期工作。我不知道如何解决是使图像边框抗锯齿。
放大后的图像如下:
即图像结束的边界和图像的透明“背景”开始的边界是粗剪,而不是平滑的 alpha 混合。
我的问题是:
是否可以剪切绘制的图像并启用抗锯齿功能?
【问题讨论】:
-
刚刚找到this article,我认为这将是要走的路。现在就试试。
标签: c# .net graphics system.drawing clipping