当前位置:网站首页>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边栏推荐
- [Shangshui Shuo series together] day 10
- Why is the website slow to open?
- Jedis source code analysis (II): jediscluster module source code analysis
- [together Shangshui Shuo series] day 7 content +day8
- CAD插件的安裝和自動加載dll、arx
- Deep learning, thinking from one dimensional input to multi-dimensional feature input
- 88. 合并两个有序数组
- Redhat7系统root用户密码破解
- [teacher Zhao Yuqiang] kubernetes' probe
- Analysis of the example of network subnet division in secondary vocational school
猜你喜欢
多线程与高并发(7)——从ReentrantLock到AQS源码(两万字大章,一篇理解AQS)
Kubernetes notes (III) controller
[teacher Zhao Yuqiang] Cassandra foundation of NoSQL database
Mapbox tasting value cloud animation
Kubernetes cluster environment construction & Deployment dashboard
[escape character] [full of dry goods] super detailed explanation + code illustration!
[explain in depth the creation and destruction of function stack frames] | detailed analysis + graphic analysis
[teacher Zhao Yuqiang] redis's slow query log
Kubernetes notes (II) pod usage notes
[teacher Zhao Yuqiang] calculate aggregation using MapReduce in mongodb
随机推荐
[video of Teacher Zhao Yuqiang's speech on wot] redis high performance cache and persistence
Solve the problem of automatic disconnection of SecureCRT timeout connection
Core principles and source code analysis of disruptor
pytorch 多分类中的损失函数
2022.DAY592
Maximum likelihood estimation, divergence, cross entropy
Crontab command usage
Kubernetes notes (IX) kubernetes application encapsulation and expansion
Sophomore dilemma (resumption)
Btrfs and ext4 - features, strengths and weaknesses
Multithreading and high concurrency (7) -- from reentrantlock to AQS source code (20000 words, one understanding AQS)
Complete set of C language file operation functions (super detailed)
[together Shangshui Shuo series] day 7 content +day8
Detailed explanation of findloadedclass
Understand the first prediction stage of yolov1
Configure DTD of XML file
Clickhouse learning notes (I): Clickhouse installation, data type, table engine, SQL operation
[teacher Zhao Yuqiang] index in mongodb (Part 1)
Kubernetes cluster environment construction & Deployment dashboard
2022.6.30DAY591