如何使用修复大小调整文本大小只是更改文本高度?

问题描述:

您好,



我想更改动态字体大小,但只需更改高度,应该是文本的固定宽度。



字体font3 =新字体(Times New Roman,(int)(15),FontStyle.Bold,GraphicsUnit.Pixel);

graphics.DrawString( A,font2,新的SolidBrush(Color.FromArgb(0,0,0)),60,240,sf);



我无法分开控制(只是高度)的文字。



我尝试过:



Font font3 = new Font(Times New Roman,(int)(15),FontStyle.Bold,GraphicsUnit.Pixel);

graphics.DrawString(A,font3,new SolidBrush (Color.FromArgb(0,0,0)),60,240,sf);

Hello,

I want to change the dynamic font size, but just change the height and should be fixed width of the text.

Font font3 = new Font("Times New Roman", (int)(15), FontStyle.Bold, GraphicsUnit.Pixel);
graphics.DrawString("A", font2, new SolidBrush(Color.FromArgb(0, 0, 0)), 60, 240, sf);

I can't separate control (just height) on the text.

What I have tried:

Font font3 = new Font("Times New Roman", (int)(15), FontStyle.Bold, GraphicsUnit.Pixel);
graphics.DrawString("A", font3, new SolidBrush(Color.FromArgb(0, 0, 0)), 60, 240, sf);

执行此操作的一种方法是将字体渲染为中间位图,然后缩放位图的高度。然后将其渲染到您的显示器中。
One way to do this would be to render the font into an intermediate bitmap and then scale the height of the bitmap. This would then be rendered into your display.