Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top