1
-(void)drawJPEG
{
NSArray* objects = [[NSBundle mainBundle] loadNibNamed:@"View" owner:nil options:nil];
UIView* mainView = [objects objectAtIndex:0];
for (UIView* view in [mainView subviews]) {
if([view isKindOfClass:[UIImageView class]])
{
UIImage* PassportSizePhoto = [UIImage imageNamed:@"1.jpeg"];
[self drawImage:PassportSizePhoto inRect:view.frame];
}
}
UIImage *image;
UIGraphicsBeginImageContext(mainView.bounds.size);
{
[mainView.layer renderInContext:UIGraphicsGetCurrentContext()];
image = UIGraphicsGetImageFromCurrentImageContext();
}
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);
}
你在這裏有什麼問題? – Mani
爲什麼你使用jpeg圖像,你可以請求解釋這個問題 – Sierra