0

I have the following code to merge two pictures side by side horizontally :

        CGFloat firstWidth = ImageLeft.size.width;
        CGFloat firstHeight = ImageLeft.size.height;


        CGFloat secondWidth = ImageRight.size.width;
        CGFloat secondHeight = ImageRight.size.height;

        CGSize sizetoNewImage = CGSizeMake(firstWidth+secondWidth , firstHeight); // Here merging two images horizontally ,

        UIGraphicsBeginImageContext(sizetoNewImage);

        [ImageLeft drawInRect : CGRectMake(0,0,firstWidth,firstHeight)];
        [ImageRight drawInRect:CGRectMake(firstWidth,0,secondWidth,secondHeight)];// Here merging two images horizontally ,

        backgroundImage = UIGraphicsGetImageFromCurrentImageContext();
        UIGraphicsEndImageContext();

The problem is that when i show backgroundImage it has all text blurred. Although, if i display separate images, that were used to join into one image - they show all text just fine. What I am missing there ???

Thanks in advance

Adviser2010
  • 115
  • 1
  • 9

1 Answers1

2

From another answer, when using retina images, use the following to create image context.

UIGraphicsBeginImageContextWithOptions(size, NO, 0.0f); // 0.0 means [UIScreen mainScreen].scale
Community
  • 1
  • 1
maroux
  • 3,764
  • 3
  • 23
  • 32