Rect size for image size based image iOS Objective C
Solution:
- (CGRect)contentClippingRect:(U
CGRect imageRect;
CGFloat scaleX = img.bounds.size.width/img.imag
CGFloat scaleY = img.bounds.size.height/img.ima
if(scaleX < scaleY) {
imageRect = CGRectMake(0, (img.bounds.size.height - scaleX*img.image.size.he
} else {
imageRect = CGRectMake((img.bounds.size.wi
}
return imageRect;
}
Comments
Post a Comment