UIImage *snapshot;
CGImageRef cgScreen = UIGetScreenImage();
if (cgScreen) {
snapshot = [UIImage imageWithCGImage:cgScreen];
CGImageRelease(cgScreen);
}
CGRect rect = CGRectMake(0,125, 640, 750);//创建要剪切的矩形框 这里你可以自己修改
UIImage *res = [UIImage imageWithCGImage:CGImageCreateWithImageInRect([snapshot CGImage], rect)];
NSLog(@"ssf:%@",res );
_imageViewW.image = res; //res 为截屏的图片
CGImageRef cgScreen = UIGetScreenImage();
if (cgScreen) {
snapshot = [UIImage imageWithCGImage:cgScreen];
CGImageRelease(cgScreen);
}
CGRect rect = CGRectMake(0,125, 640, 750);//创建要剪切的矩形框 这里你可以自己修改
UIImage *res = [UIImage imageWithCGImage:CGImageCreateWithImageInRect([snapshot CGImage], rect)];
NSLog(@"ssf:%@",res );
_imageViewW.image = res; //res 为截屏的图片