iOS : Save image with custom resolution

前端 未结 9 2022
长发绾君心
长发绾君心 2020-12-08 03:42

Hi I am try to capture a view then save as an image into Photo Library , but I need create a custom resolution for captured image , here is my code but when app saves the im

9条回答
  •  [愿得一人]
    2020-12-08 03:43

    CGSize sizePic = CGSizeMake(320, 460);
        UIGraphicsBeginImageContext(sizePic);
        [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
        UIImage *imagePic = UIGraphicsGetImageFromCurrentImageContext();
        UIGraphicsEndImageContext();
        UIImageWriteToSavedPhotosAlbum(imagePic, nil, nil, nil);
    

提交回复
热议问题