UIPasteBoard, Image & Retina Display

347 views Asked by At

I'm generating an image using the following:

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

Here's what I'm trying to do... I'm trying to paste an image into iMessage so that it looks like a regular message except with a different background color (I'm basically adding an image of a label). Here's the thing, if I draw the image at a scale of 1.0 the size of the image matches perfectly to what normal one-line bubbles look like. The problem is it looks really blurry. And If I scale it at 0.0 or 2.0 then the image looks perfect except, it is too big (2x the size I want) in iMessages.

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

0

There are 0 answers