[英]Rendering a full sized image with UIGraphicsImageRenderer
Images taken with our device camera's are larger than the screen on our iOS device. 用我们的设备相机拍摄的图像大于我们的iOS设备上的屏幕。 Usually when we render an image in iOS i see people setting their rendering size to the size of the main view or their image view.
通常,当我们在iOS中渲染图像时,我会看到人们将其渲染大小设置为主视图或图像视图的大小。
As shown in this stack overflow response . 如该堆栈溢出响应所示 。
Doing so will make the image smaller and lower quality. 这样做会使图像变小并降低质量。
If the logic follows. 如果遵循逻辑。
Would it be possible to render the image with it's full size if I make the image view go beyond the device screen. 如果我使图像视图超出设备屏幕,是否可以渲染完整尺寸的图像。 In other words the image view will be set to the size of the original full sized image.
换句话说,图像视图将被设置为原始全尺寸图像的大小。
Will doing this generate a rendered image with the same pixel size of the original image ? 这样会生成具有与原始图像相同像素大小的渲染图像吗?
What have I done so far ? 到目前为止,我做了什么? I have tested other image overlaying/editing apps and they seem to reduce the image's pixel size.
我已经测试了其他图像叠加/编辑应用程序,它们似乎减小了图像的像素大小。 I used the methods provided in the link above and they also do the same.
我使用了上面链接中提供的方法,它们也相同。
Yes it's definitely possible by embedding a UIImageView
in a UIScrollView
and using sizeToFit
: 是的,通过将
UIImageView
嵌入UIScrollView
并使用sizeToFit
绝对有可能:
imageView.image = image;
[imageView sizeToFit];
scrollView.contentSize = image.size;
You will then be able to pan across the image within the scroll view. 然后,您将可以在滚动视图中平移图像。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.