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 9211625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:20:27+00:00 2026-06-18T01:20:27+00:00

Image: https://i.stack.imgur.com/pbzar.png I want to get text on 90-270 degrees (text Aroma 7 to

  • 0

Image: https://i.stack.imgur.com/pbzar.png

I want to get text on 90-270 degrees (text “Aroma 7” to “Aroma 17”), rotated 180 degrees.

My code:

 for (int i=0; i<24; i++) {
    CGContextSaveGState(context);
    CGContextRef context = UIGraphicsGetCurrentContext();
    NSString *str = [NSString stringWithFormat:@"Aroma %d", i];

    CGContextTranslateCTM(context, radius, radius);
    CGContextRotateCTM(context, i * 15 * M_PI/180.0);
    [[UIColor whiteColor] set];

    CGContextTranslateCTM(context, - (radius), -(radius));

    CGSize size = [str sizeWithFont:[UIFont fontWithName:@"Helvetica" size:12.0]
                     constrainedToSize:rect.size
                         lineBreakMode:(NSLineBreakByWordWrapping)];

    [str drawAtPoint:CGPointMake(((radius * 2) - 10) - size.width, radius) withFont:[UIFont fontWithName:@"Helvetica" size:12.0]];


    CGContextRestoreGState(context);
}

Thanks for the help!

  • 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. Editorial Team
    Editorial Team
    2026-06-18T01:20:28+00:00Added an answer on June 18, 2026 at 1:20 am

    This should produce the wanted output:

    for (int i=0; i<24; i++) {
        CGContextSaveGState(context);
        CGContextRef context = UIGraphicsGetCurrentContext();
        NSString *str = [NSString stringWithFormat:@"Aroma %d", i];
    
        CGContextTranslateCTM(context, radius, radius);
        CGContextRotateCTM(context, i * 15 * M_PI/180.0);
        [[UIColor whiteColor] set];
        CGSize size = [str sizeWithFont:[UIFont fontWithName:@"Helvetica" size:12.0]
                      constrainedToSize:rect.size
                          lineBreakMode:(NSLineBreakByWordWrapping)];
    
        CGContextTranslateCTM(context, radius-10-size.width/2, size.height/2); // (1)
        if (i >= 7 && i <= 17)
            CGContextRotateCTM(context, M_PI); // (2)
        [str drawAtPoint:CGPointMake(-size.width/2, -size.height/2) withFont:[UIFont fontWithName:@"Helvetica" size:12.0]];
    
        CGContextRestoreGState(context);
    }
    

    The idea is to move the origin of the coordinate system to the center of the rectangle where the text is to be drawn (see (1)). Then you can simply rotate the text by 180 degrees (see (2)).

    This is the output of my test program:

    enter image description here

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

Sidebar

Related Questions

I want to make a UI like this image https://i.stack.imgur.com/bB8UM.png .I use the basic
https://i.stack.imgur.com/bRXcy.png This image is a 78*24 image of the alphabet, with each letter in
Image: https://i.stack.imgur.com/53Ms1.png I have been working with XNA some time now and this is
See the following image: https://i.stack.imgur.com/F3znK.png See those transparent circles in the background? What i
hi i want to create image button like this way https://i.stack.imgur.com/o2KsD.jpg in this url
I have to go from a) to b) : https://i.stack.imgur.com/9hWxJ.png (the green stock-image is
Basically when I draw text it's ending up black like this: https://i.stack.imgur.com/z675F.png Instead of
Input Image -- https://i.stack.imgur.com/hIqEd.png Output Image with Convex Hull of contours drawn -- https://i.stack.imgur.com/pEKPP.png
Please look to this picture https://i.stack.imgur.com/A2RB2.jpg i want to get sum of money in
this is my layout (image): https://i.stack.imgur.com/wPx04.jpg What I want to do is make the

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.