C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » Graphics »

Rotate the string


Posted Date: 17 Aug 2009    Resource Type: Code Snippets    Category: Graphics
Author: Shunmuganathan MMember Level: Diamond    
Rating: 1 out of 5Points: 5



Description :


We can rotate the text by giving angel.
We can rotate the text simply override the onPaint event
The Following is the code for rotating the text.

protected override void OnPaint(PaintEventArgs e)
{
Graphics MyGraphics = e.Graphics;
MyGraphics.FillRectangle(Brushes.White, this.ClientRectangle);
Font MyFont = new Font("Times New Roman", 24);
MyGraphics.DrawString("The Text for rotate", MyFont, Brushes.Black, 0, 0);
MyGraphics.RotateTransform(45);
MyGraphics.TranslateTransform(150, 0);
MyGraphics.DrawString("The Text for rotate", MyFont, Brushes.Black, 0, 0);
}


Code Explanation

1. Create the instance of the Graphics
2. Fill it with rectangle
3. Create the instance of the Font
4. Write the text in the instance of the Graphics
5. Rotate the string by giving the angle.
6. Draw the string again

By
Nathan



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Rotate the string  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Show your Label in different color in Runtime C#
Previous Resource: Mathematics SET in Graphics view
Return to Discussion Resource Index
Post New Resource
Category: Graphics


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use