使用C#在Windows应用程序中旋转标签时缺少字体质量 [英] Font quality missing while I rotating the label in windows application using C#

查看:92
本文介绍了使用C#在Windows应用程序中旋转标签时缺少字体质量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中,我需要垂直打印标签。所以我通过使用dll垂直标签(自定义控件)来做到这一点。它垂直旋转但缺少Font的质量。请帮助我。

in my project i have a requirement to print labels vertically .So i did that by using a dll of Vertical Label (custom Control).it rotates vertically but the quality of Font is missing.please help me.

推荐答案

我们不知道VerticalLabel控件是什么或它是如何工作的:如果你从一篇文章中获得了代码,那么就会有一个添加注释或问题按钮。该文章的底部,它会将电子邮件发送给作者。然后他们会被告知你希望与他们交谈。

在这里发布这个依赖于他们匆匆而过并意识到这是为了他们。



如果你在其他地方得到它,那么你真的需要从那里开始并询问编写它的人!
We have no idea what the VerticalLabel control is or how it works: if you got the code from an article, then there is a "Add a Comment or Question" button at the bottom of that article, which causes an email to be sent to the author. They are then alerted that you wish to speak to them.
Posting this here relies on them "dropping by" and realising it is for them.

If you got it elsewhere, then you really need to start there and ask the person who wrote it!


这听起来很奇怪。我不仅以任意角度旋转文本,而且还使用文本进行了任意仿射变换,据我记忆,字体渲染质量非常好。



由于你没有显示任何呈现文本的代码,我不知道为什么它会降低渲染质量。最好问一下这段代码的作者。我猜这是使用的 System.Drawing.Graphics 实例的选项属性的问题。更好的是,如果这真的是一个问题,抛弃这个糟糕的代码并编写自己的代码。



我会给你这个想法。在方法 System.Windows.Forms.Control.OnPaint 中你必须覆盖,你将给出 System.Drawing.Graphics 传入事件参数参数。在此实例上执行必需的仿射变换

Graphics.Transform Property(System.Drawing)

Matrix Class(System.Drawing.Drawing2D)(特别是,查看旋转* 方法)。



另外,请注意与渲染质量相关的成员,阅读它们:

图形类(System.Drawing)



-SA
It sounds weird. Not only I rotated text at arbitrary angle, but I've done arbitrary affine transform with text, and, as far as I remember, the quality of font rendering was quite good.

As you did not show any code rendering the text, I have no idea why it screwed up quality of rendering. Better ask the author of this code. I would guess it's the problems of option properties of the instance of System.Drawing.Graphics used. Better yet, if this is really a problem, throw out this lousy code and write your own.

I'll give you the idea. In the method System.Windows.Forms.Control.OnPaint you have to override, you will given the instance of System.Drawing.Graphics passed in event arguments parameter. Perform required affine transform on this instance:
Graphics.Transform Property (System.Drawing),
Matrix Class (System.Drawing.Drawing2D) (in particular, look at Rotate* methods).

Also, pay attention for the members related to rendering quality, read about them:
Graphics Class (System.Drawing).

—SA


这篇关于使用C#在Windows应用程序中旋转标签时缺少字体质量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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