How to use C # To display vertical lines of text?

Source: Internet
Author: User

Looking at this question, I think it is not difficult. I thought it was the same at the beginning, but currently I have no reference on my hand to introduce vertical text display, only one useful information is found on the Internet, but it is difficult to achieve it. It requires coordinate conversion, rotation, and translation. No way. In order to mark the Y-direction coordinates, we have to do this, the Code is as follows:

// Set the center of rotation
Pb_graphics.translatetransform (panelruley. width/2, panelruley. Height/2 );
// Set the Rotation Angle
Pb_graphics.rotatetransform (90 );
// Translation
Pb_graphics.translatetransform (I-19-panelruley. Height/2 + 22-(20-panelwork.top),-3 );
// Draw text
Pb_graphics.drawstring (INT) (I-19). tostring (), Font, new solidbrush (color. Black), 0, 0 );
// Restore to the default scenario
Pb_graphics.resettransform ();

It may have ended like this. However, today I walked around in the bookstore and saw a more direct way to implement vertical lines of text, so I quickly bought the book, the method of returning home implements vertical lines of text. The latest code is as follows (only one sentence of 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 streamlined framework set is not supported. I tried this code under the streamlined framework set, so I did not find this 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.