Guest User

Untitled

a guest
Dec 11th, 2012
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CGContextRef context = UIGraphicsGetCurrentContext();
  2.  
  3. UIColor *color = [UIColor colorWithRed: 0.029 green: 0.195 blue: 0.288 alpha: 1];
  4. UIColor *shadowColor = [UIColor colorWithRed: 1 green: 1 blue: 1 alpha: 0.71];
  5.  
  6. CGSize shadowOffset = CGSizeMake(0.1, 1.1);
  7. CGFloat shadowBlurRadius = 1;
  8.  
  9. NSString *yourTicket = @"Your ticket to            ticket";
  10. NSString *every = @"every";
  11.  
  12. CGRect textRect = CGRectMake(32, 41, 183, 25);
  13. CGContextSaveGState(context);
  14. CGContextSetShadowWithColor(context, shadowOffset, shadowBlurRadius, shadowColor.CGColor);
  15. [color setFill];
  16. [yourTicket drawInRect:textRect withFont:[UIFont fontWithName:@"Helvetica" size:12] lineBreakMode:UILineBreakModeWordWrap alignment:UITextAlignmentCenter];
  17. CGContextRestoreGState(context);
  18.    
  19. CGRect text2Rect = CGRectMake(100, 41, 89, 26);
  20. CGContextSaveGState(context);
  21. CGContextSetShadowWithColor(context, shadowOffset, shadowBlurRadius, shadowColor.CGColor);
  22. [[UIColor blackColor] setFill];
  23. [every drawInRect:text2Rect withFont:[UIFont fontWithName:@"Helvetica-Bold" size:12] lineBreakMode:UILineBreakModeWordWrap alignment:UITextAlignmentCenter];
  24. CGContextRestoreGState(context);
  25.  
  26. // result http://cl.ly/image/0W280W2y2a2a
Advertisement
Add Comment
Please, Sign In to add comment