打印图片锯齿问题

bobofsjyy 2014-03-19 05:20:54
在正常情况下打印的图片是正常的 没有锯齿 代码如下

Rectangle destRect = new Rectangle(0, 0, 100,100);
e.Graphics.SmoothingMode = SmoothingMode.HighQuality;
e.Graphics.DrawImage(myimg, destRect, 0, 0, myimg.Width, myimg.Height, System.Drawing.GraphicsUnit.Pixel);


但是如果做一个旋转 打印出来的图片马上就有锯齿


Matrix m=new Matrix();
m.RotateAt(180f, 50,50);
Rectangle destRect = new Rectangle(0, 0, 100,100);
e.Graphics.Transform = m;
e.Graphics.SmoothingMode = SmoothingMode.HighQuality;
e.Graphics.DrawImage(myimg, destRect, 0, 0, myimg.Width, myimg.Height, System.Drawing.GraphicsUnit.Pixel);
...全文
716 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhoujk 2014-03-21
  • 打赏
  • 举报
回复
会不会是旋转算法的坐标精度造成的边缘效应?到我的BLOG去看看,有这两种算法的输出对比
laviewpbt 2014-03-20
  • 打赏
  • 举报
回复
GDII+的旋转,无论你怎么设置,都会有至少两个边不抗锯齿。
bobofsjyy 2014-03-20
  • 打赏
  • 举报
回复
自己
顶一下
bobofsjyy 2014-03-19
  • 打赏
  • 举报
回复
e.Graphics.SmoothingMode = SmoothingMode.HighQuality; e.Graphics.InterpolationMode = InterpolationMode.High; e.Graphics.CompositingQuality = CompositingQuality.HighSpeed; 一样有锯齿
卧_槽 2014-03-19
  • 打赏
  • 举报
回复
CompositingQuality设为Height
bobofsjyy 2014-03-19
  • 打赏
  • 举报
回复
加了。 一样有锯齿
卧_槽 2014-03-19
  • 打赏
  • 举报
回复
加一句 e.Graphics.InterpolationMode=InterpolationMode.Height;

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧