当前位置:网站首页>Get a screenshot of a uiscrollview, including off screen parts
Get a screenshot of a uiscrollview, including off screen parts
2022-07-03 06:01:00 【Rich in starch】
problem :
I have a UIScrollView decendent that implements a takeScreenshot method that looks like this: I have one UIScrollView A successor , It implements a takeScreenshot Method :
-(void)takeScreenshot { CGRect contextRect = CGRectMake(0, 0, 768, 1004); UIGraphicsBeginImageContext(contextRect.size); [self.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); // do something with the viewImage here.}This basically moves to the top of the scroll view, and takes a screenshot of the visible area. This basically moves to the top of the scrolling view , And take a screenshot of the visible area .It works fine when the iPad is oriented portrait, but when it's in landscape the bottom of the image is cut off (as the height of the visible area is only 748, not 1004). When iPad It works normally when facing vertically , But when it is horizontal , The bottom of the image is cut off ( Because the height of the visible area is only 748, instead of 1004).
Is it possible to get a snapshot of the UIScrollView , including areas not on screen? Whether you can get UIScrollView Snapshot , Include areas that are not on the screen ?Or do I need to scroll the view down, take a second photo and stitch them together? Or do I need to scroll down the view , Take a second picture and put them together ?
Solution :
Reference resources : https://stackoom.com/en/question/EqqD边栏推荐
- Personal outlook | looking forward to the future from Xiaobai's self analysis and future planning
- [teacher Zhao Yuqiang] use the catalog database of Oracle
- 88. 合并两个有序数组
- 88. Merge two ordered arrays
- 伯努利分布,二项分布和泊松分布以及最大似然之间的关系(未完成)
- Kubernetes notes (V) configuration management
- Apt update and apt upgrade commands - what is the difference?
- Detailed explanation of findloadedclass
- [teacher Zhao Yuqiang] Cassandra foundation of NoSQL database
- 项目总结--01(接口的增删改查;多线程的使用)
猜你喜欢

Jedis source code analysis (II): jediscluster module source code analysis
![[trivia of two-dimensional array application] | [simple version] [detailed steps + code]](/img/84/98c1220d0f7bc3a948125ead6ff3d9.jpg)
[trivia of two-dimensional array application] | [simple version] [detailed steps + code]

Jedis source code analysis (I): jedis introduction, jedis module source code analysis
![[teacher Zhao Yuqiang] index in mongodb (Part 2)](/img/a7/2140744ebad9f1dc0a609254cc618e.jpg)
[teacher Zhao Yuqiang] index in mongodb (Part 2)
![[teacher Zhao Yuqiang] index in mongodb (Part 1)](/img/2d/277ec737f2a7065831a19d036e61e1.jpg)
[teacher Zhao Yuqiang] index in mongodb (Part 1)

Life is a process of continuous learning

深度学习,从一维特性输入到多维特征输入引发的思考

【一起上水硕系列】Day 7 内容+Day8

JDBC connection database steps

Kubernetes cluster environment construction & Deployment dashboard
随机推荐
[teacher Zhao Yuqiang] use Oracle's tracking file
Installation of CAD plug-ins and automatic loading of DLL and ARX
一起上水碩系列】Day 9
88. 合并两个有序数组
[teacher Zhao Yuqiang] RDB persistence of redis
Solve the problem that Anaconda environment cannot be accessed in PowerShell
Jedis source code analysis (I): jedis introduction, jedis module source code analysis
AtCoder Beginner Contest 258(A-D)
Ensemble, série shuishu] jour 9
Es remote cluster configuration and cross cluster search
Kubernetes resource object introduction and common commands (V) - (configmap)
Crontab command usage
Installation du plug - in CAD et chargement automatique DLL, Arx
Code generator - single table query crud - generator
pytorch 多分类中的损失函数
Yum is too slow to bear? That's because you didn't do it
Method of finding prime number
@Import annotation: four ways to import configuration classes & source code analysis
The programmer shell with a monthly salary of more than 10000 becomes a grammar skill for secondary school. Do you often use it!!!
Redhat7 system root user password cracking