NSString *path =[[NSBundle mainBundle] pathForResource:@"icon" ofType:@"png"];
MyImage = [UIImage imageWithContentsOfFile:path];


UIGraphicsBeginImageContext(currentView.bounds.size);     //currentView 当前的view
[currentView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);
UIGraphicsBeginImageContext(currentView.bounds.size);     //currentView 当前的view
[currentView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);

相关文章:

  • 2021-11-02
  • 2022-12-23
  • 2021-06-25
  • 2021-11-18
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-29
  • 2021-08-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-14
  • 2021-09-18
相关资源
相似解决方案