开发者

iPhone & Ipad - UIGetScreenImage - how to capture in landscape?

开发者 https://www.devze.com 2022-12-20 17:01 出处:网络
Apple recently decided to allow developers to use this UIGetScreenImage private API. I have implemented it and it w开发者_运维百科orks fine in portrait, but when I run the device to landscape (self.v

Apple recently decided to allow developers to use this UIGetScreenImage private API.

I have implemented it and it w开发者_运维百科orks fine in portrait, but when I run the device to landscape (self.view rotates) and UIGetScreenImage continues to capture using the screen non-rotated coordinates.

The result is a cropped landscape result.

UIGetScreenImage is the only method that works in my case, as far as I know and until you guys don't find an answer to this other question of mine :-)


I believe you need to apply the rotation yourself.

UIGetScreenImage() doesn't care about the orientation. In fact it cannot, because there can be multiple UIWindows on screen while some are autorotated, some are not.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号