且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用C#从底部到顶部方向绘制文本.

更新时间:2023-02-02 17:23:56

如果您使用的是System.Drawing,则StringFormat可能不够通用.

这是一种更为通用的工具,可让您轻松更改方向并进行其他线性变换.您需要的是属性System.Drawing.Graphics.Transform,请参阅 http://msdn. microsoft.com/en-us/library/system.drawing.graphics.transform.aspx [
If you are using System.Drawing, StringFormat might be not universal enough for you.

This is one much more universal tool which will allow you to change orientation and do other linear transformations with ease. What you need is the property System.Drawing.Graphics.Transform, please see http://msdn.microsoft.com/en-us/library/system.drawing.graphics.transform.aspx[^].

You can assign different values to the property Trasform in the middle of rendering. For example, assign instance of transform, draw a string vertically, restore transform to the saved default value or change its orientation — draw another string horizontally or at the angle or draw something else.

You can apply any affine transform. For example, this method is the only way to render, say, a text written on a wall of a box depicted at the angle in some projection…

—SA