如何提高打印文本的质量与使用后QUOT; graphics.DrawString"? [英] how to improve printed text quality after using "graphics.DrawString"?

查看:68
本文介绍了如何提高打印文本的质量与使用后QUOT; graphics.DrawString"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,我的品质文本打印后!它不是光滑antialiases!

I have a problem with my text quality after printing ! it's not smooth and antialiases!

这就是故事:

我从位图创建一个图形( Graphics.FromImage(MYBITMAP))和我觉得这是我的问题的起点,因为我不能用PrintPageEvenArg(E),但我没有别的选择!

I create a graphic from a bitmap (Graphics.FromImage(MyBitmap)) and I think it's the start point of my problem because I can't use PrintPageEvenArg(e) , but I have no other choice!

之后,我开始写这个图形一些文字:

after that I begin writing some text on this graphic:

通过阅读类似的问题的答案在本网站和其他一些人,我做我的图形性能,如smoothi​​ngMode,TextRenderingHint,一些变化......那你看到在继续......但不幸的是没有人帮我!

by reading the answers of similar Questions in this site and some others , I made some changes on my graphics properties such as smoothingMode , TextRenderingHint , ... that U see in continue... but unfortunately none of them helped me !

  SolidBrush sb = new SolidBrush(Color.White);
  graphics.FillRectangle(sb,oRectangle); //it was suggested to be done before antialiases inorder to get effects

  graphics.TextRenderingHint = TextRenderingHint.AntiAlias; //I also tried ClearTypeGridFit
  graphics.SmoothingMode = 
        System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
  graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
  graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
  graphics.CompositingQuality = CompositingQuality.HighQuality;
  graphics.CompositingMode = CompositingQuality.SourceOver;

  graphics.DrawString(strValue, boxStyle.Font, sb, oRectangle, StringFormat);

由antialising我得到了更好的边缘光滑,但我看到了很多额外的像素的靠近我的文字,我的文字颜色似乎变得更轻,所以我可以说,通过平滑的边缘我的文字质量,甚至变得更糟!

by antialising I got better smooth edge but I see a lot of extra pixel near my text and my text color seems to become lighter so I can say that by smoothing edge my text quality even got worse !

plz帮助我! thanx提前:)

plz help me ! Thanx in advance :)

推荐答案

尝试使用的这个解决方案(GraphicsPath的)。在我的项目,它工作得很好。

Try to use this solution (GraphicsPath). In my project it works very good.

这篇关于如何提高打印文本的质量与使用后QUOT; graphics.DrawString"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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