Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

drawing text using CGContextShowTextAtPoint but text shown is inverted,

Tags:

iphone

  - (void)drawRect:(CGRect)rect {
    CGContextRef  context = UIGraphicsGetCurrentContext();


    CGContextSelectFont(context, "Arial", 24, kCGEncodingMacRoman);


    CGContextShowTextAtPoint(context, 80, 80, "I am Rahul", 7);





 }

I am trying to draw text as shown above "I am Rahul" but when i execute the code,
text gets shown, but it is inverted, why it is happening I am not getting !! help!!

like image 410
Rahul Avatar asked May 12 '10 07:05

Rahul


1 Answers

You can use this code :

CGContextSetTextMatrix(context, CGAffineTransformMake(1.0,0.0, 0.0, -1.0, 0.0, 0.0));
like image 81
thierryb Avatar answered Sep 22 '22 10:09

thierryb