Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 185429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:28:06+00:00 2026-05-11T15:28:06+00:00

I am attempting to rotate some text within a label. I have a cusom

  • 0

I am attempting to rotate some text within a label. I have a cusom label which allows me to have control over the text rendering process.

protected override void OnPaint ( PaintEventArgs pe ) {     Graphics g = pe.Graphics;     g.RotateTransform( angle );      g.drawString( text );      g.ResetTransform(); } 

The problem I am having is that the rotation appears to occur aroundthe origin of the control i.e. co-ordinates (0,0). Is there a method to allow the text to rotate about the center of the control rather than the oragin?

I am aware of the function ‘g.RotateTransform( )’ so one possible solution would be to rotate the text and then translate it to the centre of the control. If this is the only way to manage the job, is there a generic manner which I can caluclate the transfor to ensure that the text is in the centre of the control?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T15:28:06+00:00Added an answer on May 11, 2026 at 3:28 pm

    A rotation around an arbitrary point is usually a translation of that point to the origin, then a rotation and a translation back again. The problem would probably be to determine the dimensions of the text after rotation to move it back accordingly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to rotate a div to which I have applied a 'page curl'
Attempting to build a C# NPAPI plugin I have found a tutorial which describes
Attempting/struggling to get registration and sign-up working within an active admin project. I have
Attempting to write a line to a text file in Python 2.7, and have
I'm new to jquery and attempting to display text when hovering over a div.
Attempting to get Spring internationalization working. I have used classpath:messages basename, created .properties files
Attempting to set up an automated texting service for customers, where people can text
Attempting to implement a poor man's test of whether a process is still running
Attempting to build a C# project which has numerous references to assemblies in NuGet
I'm attempting to rotate a MovieClip by a fixed amount in degrees it has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.