0

I'm just taking a signature and saving with imageMask . Here actually the imageMask rendering properly but the main signature behaves abnormally like 2 lines of it. Here is my code .

UIGraphicsBeginImageContextWithOptions(imageView.bounds.size, NO, 1.0); //retina res
    [self.imageView.layer renderInContext:UIGraphicsGetCurrentContext()];
    [imageView.image drawInRect:CGRectMake(0, 0, 703, 273)];
    [maskImages.image drawAtPoint:CGPointMake(10, 10) blendMode:kCGBlendModeNormal alpha:0.2];
    [lblAckNo drawTextInRect:CGRectMake(320, 230,100,50)];

    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    [[UIColor redColor] set];
    NSData *imgData =  UIImageJPEGRepresentation(image, 1.0);
     UIGraphicsEndImageContext();
        NSString *jpgPath = @"/Users/kumaralakshmanna/Pictures/Test.jpg";
        [UIImageJPEGRepresentation(image, 1.0) writeToFile:jpgPath atomically:YES];

Here is the screenshots of it.Before Saving && This is what I'm getting -After Saved

Any Solution to overcome from this issue .? Thanks.

Kumar KL
  • 15,315
  • 9
  • 38
  • 60
  • And the problem is? Where those three images come from? – marzapower May 25 '13 at 07:00
  • There are 2 images , In the 1st one, I'm putting signature When I hit "OK" It Captures and shown up , there itself I added one UIImage as Mask. 2nd one showing after I hit "Agree & Submit " It saves . – Kumar KL May 25 '13 at 07:04
  • The 1st one is the Signature View , It uses some graphics to take some drawing . After I hit , it saves perfectly. When I'm going to save with maskImage ..I'm getting the image like this. – Kumar KL May 25 '13 at 07:08
  • Are you copying and printing the signature in the same `CGSize`? Maybe the second one is a bit smaller. – marzapower May 25 '13 at 07:08
  • Just added an "official" answer :) – marzapower May 25 '13 at 07:20

1 Answers1

1

Make sure that you are drawing using the same CGSize. You are probably using two different size to capture the image and to draw it, so it gets stretched.

marzapower
  • 5,531
  • 7
  • 38
  • 76