• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
iPhone text on UIImage not getting displayed on device.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

iPhone text on UIImage not getting displayed on device.


  • Subject: iPhone text on UIImage not getting displayed on device.
  • From: Shraddha Karwan <email@hidden>
  • Date: Tue, 19 May 2009 12:13:00 +0530

I used the following function to add text on UIImage. I can display the text
on iPhone Simulator but its not getting displayed on the actual device. What
can be the cause?

 CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
 CGContextRef context = CGBitmapContextCreate(NULL, w, h, 8, 4 * w,
colorSpace, kCGImageAlphaPremultipliedFirst);

 CGContextDrawImage(context, CGRectMake(0, 0, w, h), img.CGImage);
 CGContextSetRGBFillColor(context, 0.0, 0.0, 1.0, 1);

 char* text = (char *)[text1 cStringUsingEncoding:NSASCIIStringEncoding];//
"05/05/09";
 CGContextSelectFont(context, "Arial", 12, kCGEncodingMacRoman);
 CGContextSetTextDrawingMode(context, kCGTextFill);
 CGContextSetRGBFillColor(context, 255, 255, 255, 1);

  CGContextShowTextAtPoint(context, 4, 130, text, strlen(text));
  CGImageRef imageMasked = CGBitmapContextCreateImage(context);
 CGContextRelease(context);
 CGColorSpaceRelease(colorSpace);

  return [UIImage imageWithCGImage:imageMasked];
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: iPhone text on UIImage not getting displayed on device.
      • From: David Duncan <email@hidden>
    • Re: iPhone text on UIImage not getting displayed on device.
      • From: Luke the Hiesterman <email@hidden>
  • Prev by Date: re: Programatically set file URL of Core Data Document?
  • Next by Date: Is there two streams with CFReadStreamRead happend in two threads?
  • Previous by thread: Re: NSEvent virtual keycodes
  • Next by thread: Re: iPhone text on UIImage not getting displayed on device.
  • Index(es):
    • Date
    • Thread