#pragma mark 根据指定的大小来裁剪图片
+(UIImage *)returnClicpImageFromBottomBaseOnSize:(CGSize)Newsize OldImage:(UIImage *)imageOld
{
CGImageRef imgRef=imageOld.CGImage;
//从图片的上方开始裁剪图片
CGRect rect1 = CGRectMake(0,0,Newsize.width,Newsize.height);
NSLog(@"指定的宽度 %f 高度 %f",rect1.size.width,rect1.size.height);
CGImageRef img=CGImageCreateWithImageInRect(imgRef,rect1);
UIImage *subImage=[UIImage imageWithCGImage:img];
NSLog(@"宽度:%f 高度%f",subImage.size.width,subImage.size.height);
CGImageRelease(img);
return subImage;
}
+(UIImage *)returnClicpImageFromBottomBaseOnSize:(CGSize)Newsize OldImage:(UIImage *)imageOld
{
CGImageRef imgRef=imageOld.CGImage;
//从图片的上方开始裁剪图片
CGRect rect1 = CGRectMake(0,0,Newsize.width,Newsize.height);
NSLog(@"指定的宽度 %f 高度 %f",rect1.size.width,rect1.size.height);
CGImageRef img=CGImageCreateWithImageInRect(imgRef,rect1);
UIImage *subImage=[UIImage imageWithCGImage:img];
NSLog(@"宽度:%f 高度%f",subImage.size.width,subImage.size.height);
CGImageRelease(img);
return subImage;
}