当前位置:网站首页>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边栏推荐
- C 语言文件操作函数大全 (超详细)
- 一起上水硕系列】Day 9
- 【一起上水硕系列】Day 10
- 【一起上水硕系列】Day 7 内容+Day8
- MySQL startup error: several solutions to the server quit without updating PID file
- Code generator - single table query crud - generator
- Final review (day3)
- How to create your own repository for software packages on Debian
- 从小数据量分库分表 MySQL 合并迁移数据到 TiDB
- The programmer shell with a monthly salary of more than 10000 becomes a grammar skill for secondary school. Do you often use it!!!
猜你喜欢
![[video of Teacher Zhao Yuqiang's speech on wot] redis high performance cache and persistence](/img/a7/2140744ebad9f1dc0a609254cc618e.jpg)
[video of Teacher Zhao Yuqiang's speech on wot] redis high performance cache and persistence
![Together, Shangshui Shuo series] day 9](/img/39/c1ba1bac82b0ed110f36423263ffd0.png)
Together, Shangshui Shuo series] day 9

pytorch 搭建神经网络最简版

pytorch DataLoader实现miniBatch(未完成)

理解 期望(均值/估计值)和方差

Simple handwritten ORM framework
![[teacher Zhao Yuqiang] redis's slow query log](/img/a7/2140744ebad9f1dc0a609254cc618e.jpg)
[teacher Zhao Yuqiang] redis's slow query log
![[teacher Zhao Yuqiang] index in mongodb (Part 2)](/img/a7/2140744ebad9f1dc0a609254cc618e.jpg)
[teacher Zhao Yuqiang] index in mongodb (Part 2)

Es remote cluster configuration and cross cluster search

深度学习,从一维特性输入到多维特征输入引发的思考
随机推荐
[function explanation (Part 2)] | [function declaration and definition + function recursion] key analysis + code diagram
How to create your own repository for software packages on Debian
深度学习,从一维特性输入到多维特征输入引发的思考
Skywalking8.7 source code analysis (I): agent startup process, agent configuration loading process, custom class loader agentclassloader, plug-in definition system, plug-in loading
Es 2022 officially released! What are the new features?
Final review (day3)
Configure DTD of XML file
SVN分支管理
Mapbox tasting value cloud animation
BeanDefinitionRegistryPostProcessor
[untitled]
Multithreading and high concurrency (7) -- from reentrantlock to AQS source code (20000 words, one understanding AQS)
智牛股项目--04
Download the corresponding version of chromedriver
Simple handwritten ORM framework
Solve the problem of automatic disconnection of SecureCRT timeout connection
Es remote cluster configuration and cross cluster search
Kubernetes notes (IX) kubernetes application encapsulation and expansion
Clickhouse learning notes (I): Clickhouse installation, data type, table engine, SQL operation
1. 两数之和