如何控制抽绳的方向? [英] How to control the orientation of Drawstring?

查看:88
本文介绍了如何控制抽绳的方向?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想绘制一个字符串作为轴标签。当使用以下代码绘制字符串时,可以从左侧读取它。文本的基线在左侧。

I want to draw a string as an axis label. When I draw the string with following code, I can read it "from the left". The base line of the text is at the left side.

StringFormat format = CustomGraphics.StringFormat(ContentAlignment.MiddleCenter);
format.FormatFlags |= StringFormatFlags.DirectionVertical;
e.Graphics.DrawString(this.yAxis.Title.Text, this.yAxis.Title.Font,
                      textBrush, e.Bounds, format);
format.FormatFlags &= ~StringFormatFlags.DirectionVertical;

我想垂直绘制,但将方向旋转180度。我该如何控制?我还应该使用另一种方法吗?

I want to draw vertical but turn the orientation by 180 degrees. How can I control this? Is there another method that I should use?

推荐答案

如何在C#中旋转标签?包含一种强大而强大的绘制方法,该方法最初基于 http://www.codeproject.com/KB/miscctrl/customtext.aspx

How do I rotate a label in C#? contains a long and powerful paint method, based originally on http://www.codeproject.com/KB/miscctrl/customtext.aspx

这篇关于如何控制抽绳的方向?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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