Get the App
SLTechnology News&Howtos  ›  Development  › 

How does ios implement image processing to get only part of the picture?

Shulou Source: shulou.com Published: 2022-06-01 04:18:56 10月03日 Update

This article mainly shows you "ios how to achieve picture processing only get a part of the picture", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "ios how to achieve picture processing only get a part of the picture" this article.

The image processing only gets part of the picture.

UIImage * image = [UIImage imageNamed:filename]; CGImageRef imageRef = image.CGImage; CGRect rect = CGRectMake (origin.x, origin.y, size.width, size.height); / / the width and height here is relative to the true size of the picture / / for example, if your picture is 400x400, then it is the full size of the picture. Set the corresponding coordinates to CGImageRef imageRefRect = CGImageCreateWithImageInRect (imageRef, rect); UIImage * imageRect = [[UIImage alloc] initWithCGImage:imageRefRect] The above is all the content of the article "how to get only part of the picture in ios". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Pictures processing content articles learning help coordinates size that is size easy to understand more organization knowledge editing industry information information channels channels research Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei MariaDB MySQL Xiaomi Microsoft