Good morning friends,
I was just wondering if there is anyway to draw an image with its transform values into CGContext. basically i have the following code.
but after looking at the image all the previous rotation is gone. scaling however works which is kinda strange.
any help is greatly appreciated.
I was just wondering if there is anyway to draw an image with its transform values into CGContext. basically i have the following code.
Code:
// Size of the new image.
CGSize size = CGSizeMake(width, height);
// Context.
UIGraphicsBeginImageContext(size);
CGContextRef context = UIGraphicsGetCurrentContext();
// Your images here.
UIImage *image1;
UIImage *image2;
// Draw them to the context.
[image1 drawInRect:CGRectMake(x, y, width, height)];
[image2 drawInRect:CGRectMake(x, y, width, height)];
// Construct the image from the context and return it.
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return newImage; // The thing you want.
but after looking at the image all the previous rotation is gone. scaling however works which is kinda strange.
any help is greatly appreciated.