How do I display vertical text in C #?

Source: Internet
Author: User
It's not difficult to see this problem, at the beginning, I think so, but at present, I do not have on the resources on hand to introduce vertical display text, online search data only found a useful, but to achieve more trouble, need to coordinate conversion, rotation, still have to translate, no way, In order to achieve the following figure y direction coordinates of the callout, had to do so, the code is as follows:

Set Rotation center Point
Pb_graphics.translatetransform (PANELRULEY.WIDTH/2, PANELRULEY.HEIGHT/2);
Set Rotation angle
Pb_graphics.rotatetransform (90);
Translation
Pb_graphics.translatetransform (I-19-PANELRULEY.HEIGHT/2 +-(20-panelwork.top),-3);
Draw text
Pb_graphics.drawstring (((int) (I-19)). ToString (), Font, New SolidBrush (Color.Black), 0, 0);
Revert to default scene
Pb_graphics.resettransform ();

It could have been the end of things, however, today in the bookstore stroll, readily see the more direct way to achieve vertical text, so hurriedly bought a book, go home According to its method to achieve vertical text, the latest code as follows (only a code):

Pb_graphics.drawstring (((int) (I-19)). ToString (), Font, New SolidBrush (Color.Black),-2, I-(20-panelwork.top) +2, New StringFormat ( stringformatflags.directionvertical));

Note : The thin frameset is not supported, so I'm trying this code in a thin frameset, so I didn't find the method!



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.