当前位置:网站首页>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边栏推荐
- Redhat7 system root user password cracking
- [set theory] relational closure (reflexive closure | symmetric closure | transitive closure)
- Qt读写Excel--QXlsx插入图表5
- 一起上水碩系列】Day 9
- Es 2022 officially released! What are the new features?
- Why should there be a firewall? This time xiaowai has something to say!!!
- 88. Merge two ordered arrays
- JDBC connection database steps
- Btrfs and ext4 - features, strengths and weaknesses
- Redis cannot connect remotely.
猜你喜欢

Redhat7 system root user password cracking

Apache+php+mysql environment construction is super detailed!!!

QT read write excel -- qxlsx insert chart 5

项目总结--04

How does win7 solve the problem that telnet is not an internal or external command
![[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]

Alibaba cloud OOS file upload

Core principles and source code analysis of disruptor

Es remote cluster configuration and cross cluster search

Kubernetes notes (IV) kubernetes network
随机推荐
Download the corresponding version of chromedriver
If function of MySQL
BeanDefinitionRegistryPostProcessor
The programmer shell with a monthly salary of more than 10000 becomes a grammar skill for secondary school. Do you often use it!!!
2022.7.2 simulation match
Ensemble, série shuishu] jour 9
Configure DTD of XML file
[function explanation (Part 1)] | | knowledge sorting + code analysis + graphic interpretation
[trivia of two-dimensional array application] | [simple version] [detailed steps + code]
[teacher Zhao Yuqiang] calculate aggregation using MapReduce in mongodb
Redis cannot connect remotely.
Today, many CTOs were killed because they didn't achieve business
Analysis of the example of network subnet division in secondary vocational school
Kubernetes notes (V) configuration management
Convolution operation in convolution neural network CNN
深度学习,从一维特性输入到多维特征输入引发的思考
Use telnet to check whether the port corresponding to the IP is open
Redis encountered noauth authentication required
NG Textarea-auto-resize
Solve the problem of automatic disconnection of SecureCRT timeout connection