我正在使用 CGRect 从图像视图中剪切图像。矩形是根据图像视图上的特征自动生成的,但我想将它稍微放大 10%,但在同一点附近。
为了获得我通常会使用这样的框架的大小:
CGRect frame = _imageView.frame;
CGImageRef imageRef = CGImageCreateWithImageInRect([image CGImage], frame);
UIImage *img = [UIImage imageWithCGImage:imageRef];
然后用 origin.x 更改,但是我无法获得现有矩形的框架。
非常感谢扩展 CGRect 的任何帮助