从UIView转换UIImage(截屏是一样的)

UIView *currentPictureView = [self findView:outPicker.view   withName:@"PLTileContainerView"];
  
   UIGraphicsBeginImageContext(CGSizeMake(320, 385));     //currentView 当前的view

//view的layer写入到当前上下文
    [currentPictureView.layer renderInContext:UIGraphicsGetCurrentContext()];

//从当前上下文获取image
    UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();

你可能感兴趣的:(uiimage)