如何保存初始CGContextRef
我正在 UIScrollView
中显示 PDF 页面。我开始使用 http://iosguy.com/2010/09 /04/presenting-pdf-files-by-yourself/ 文章作为背景。
当谈到缩放时,我想做以下事情以避免结果模糊。
当我打开视图时,缩放比例为 1.0。现在,我想根据整个屏幕上显示的视图以某种方式存储相应的 CGContextRef 。
然后我总是想通过滚动视图的缩放比例来缩放相应的石英坐标系,最后将坐标系转换到正确的位置,并使框架对应于滚动视图缩放比例更大/更小。
但我不知道如何保存初始的 CGContextRef 并在每次绘制矩形方法中重新加载它。
有人可以帮我吗?或者有人知道如何正确缩放 PDF 页面吗?因为,当我放大或缩小时,视图的框架会发生变化,并且图形上下文始终位于该框架内。因此,我对所有内容进行了双倍缩放(首先是框架,然后是框架内的 PDF 文档)。因此,当框架覆盖整个屏幕时(初始情况),我需要缩放 PDF。
有人可以帮我吗?
I'm displaying a PDF page inside a UIScrollView
. I started using http://iosguy.com/2010/09/04/presenting-pdf-files-by-yourself/ article as background.
When it comes to zooming I want to do the following thing to avoid blurring results.
When I open the view the zoom scale is 1.0. Now, I want to store somehow the corresponding CGContextRef
according to this view which is shown on the whole screen.
Then I always want to scale the corresponding Quartz coordinate system by the zoom scale of the scrollView and finally transform coordinate system to the right place and make the frame larger/smaller corresponding to the scroll view zoom scale.
But I don't know how to save the initial CGContextRef
and reload it every time in the drawRect method.
Can somebody help me with that? Or does somebody know how to scale the PDF page properly? Because, when I zoom in or out, the view's frame gets changed and the graphical context always lies within this frame. So I double scale everything (first the frame and then the PDF document within the frame). Hence I need to scale the PDF when the frame covers the whole screen (initial case).
Can somebody help me with that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论