8

I'm using this code to render an image from view. Then i am saving it to photo album. The image is blurry? Why? Is there a solution?

UIGraphicsBeginImageContext(self.view.bounds.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

Tnx all.

danielbeard
  • 9,120
  • 3
  • 44
  • 58
Shay
  • 2,595
  • 3
  • 25
  • 35

1 Answers1

20

You are propably using a retina device, Change the following

UIGraphicsBeginImageContext(self.view.bounds.size)

to

UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, self.view.opaque, 0.0);
Omar Abdelhafith
  • 21,163
  • 5
  • 52
  • 56