当前位置:网站首页>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边栏推荐
- [advanced pointer (2)] | [function pointer, function pointer array, callback function] key analysis + code explanation
- [teacher Zhao Yuqiang] kubernetes' probe
- pytorch 多分类中的损失函数
- Kubernetes notes (VIII) kubernetes security
- CAD插件的安裝和自動加載dll、arx
- Multithreading and high concurrency (7) -- from reentrantlock to AQS source code (20000 words, one understanding AQS)
- C 语言文件操作函数大全 (超详细)
- [teacher Zhao Yuqiang] redis's slow query log
- [Zhao Yuqiang] deploy kubernetes cluster with binary package
- [minesweeping of two-dimensional array application] | [simple version] [detailed steps + code]
猜你喜欢
[Shangshui Shuo series together] day 10
Kubernetes notes (VI) kubernetes storage
[teacher Zhao Yuqiang] MySQL high availability architecture: MHA
Simple handwritten ORM framework
Capacity expansion mechanism of map
How to create and configure ZABBIX
Maximum likelihood estimation, divergence, cross entropy
Kubernetes notes (VII) kuberetes scheduling
一起上水碩系列】Day 9
SVN分支管理
随机推荐
1. 兩數之和
CAD插件的安裝和自動加載dll、arx
Simple handwritten ORM framework
[function explanation (Part 2)] | [function declaration and definition + function recursion] key analysis + code diagram
How to create and configure ZABBIX
[teacher Zhao Yuqiang] calculate aggregation using MapReduce in mongodb
If function of MySQL
NG Textarea-auto-resize
Clickhouse learning notes (2): execution plan, table creation optimization, syntax optimization rules, query optimization, data consistency
最大似然估计,散度,交叉熵
Today, many CTOs were killed because they didn't achieve business
Configure DTD of XML file
Skywalking8.7 source code analysis (I): agent startup process, agent configuration loading process, custom class loader agentclassloader, plug-in definition system, plug-in loading
[untitled]
Convolution operation in convolution neural network CNN
【一起上水硕系列】Day 10
Ansible firewall firewalld setting
Strategy pattern: encapsulate changes and respond flexibly to changes in requirements
Redhat7系统root用户密码破解
Pytorch dataloader implements minibatch (incomplete)