Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想裁剪 300*300 的图像。我想从该图像中裁剪脸部。
我认为我们可以使用一个虚线矩形,然后根据我们想要的区域移动和缩放。
你可以试试这个
CGImageRef imageRef = CGImageCreateWithImageInRect([largeImage CGImage], cropRect); [UIImageView setImage:[UIImage imageWithCGImage:imageRef]]; CGImageRelease(imageRef);