在WPF绘制垂直文本使用DrawingContext.DrawText() [英] Drawing vertical text in WPF using DrawingContext.DrawText()

查看:4426
本文介绍了在WPF绘制垂直文本使用DrawingContext.DrawText()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做WPF中使用的DrawingContext一些自定义绘制。我使用 DrawingContext.DrawText 绘图字符串。现在,在一个地方,我想垂直绘制文本。有没有在的DrawingContext或DrawText的()函数将垂直绘制文本?任何选项

I am doing some custom drawing using DrawingContext in WPF. I am using DrawingContext.DrawText for drawing strings. Now, at a place I want to draw the text vertically. Is there any option in the DrawingContext OR DrawText() function to draw text vertically?

推荐答案

您必须使用 PushTransform 流行 的DrawingContext 类。

DrawingContext dc; // Initialize this correct value
RotateTransform RT = new RotateTransform();
RT.Angle = 90
dc.PushTransform(RT)
dc.DrawText(...);
dc.Pop();

这篇关于在WPF绘制垂直文本使用DrawingContext.DrawText()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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