UIPasteBoard, Image and Retina display

I am creating an image using the following:

UIGraphicsBeginImageContextWithOptions(labelView.bounds.size, NO, 2.0);
[labelView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *resultingImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

      

Here is what I am trying to do ... I am trying to insert an image in iMessage so that it looks like a normal message except for a different background color (I basically add a label image), Here's the thing if I draw an image at 1.0 scale , the image is sized perfectly to what normal one-line bubbles look like. The problem is, it looks really blurry. And if I scale it down by 0.0 or 2.0, then the image looks perfect, except that it is too large (twice what I want) in iMessages.

Is there a way that I can programmatically create a non-retina and a retina image programmatically and link them together so that I can add a 1.0 scale with the clarity of a 2.0 scale image?

+3


source to share





All Articles