Android - 将 ImageView 保存到具有全分辨率图像的文件
我将图像放入 ImageView 中,并实现了多点触控来调整 ImageView 中的图像大小和移动图像。现在我需要将调整大小的图像保存到图像文件中。我已经尝试过 .getDrawingCache() 但该图像具有 ImageView 的大小。我希望图像显示 ImageView 显示的内容,但具有全分辨率(大于 ImageView)。
有什么想法吗?
I put an image inside an ImageView and have multitouch implemented to resize and move the image inside the ImageView. Now I need to save the resized image to a image file. I have tried the .getDrawingCache() but that image have the size of the ImageView. I want the image to show what the ImageView shows but with full resolution (larger than the ImageView).
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在后台保存一个位图对象,您可以使用这段代码调整其大小:
并稍后使用以下代码保存它:
You could hold a Bitmap Object in Background, which you can resize with this piece of code:
And save it later using this code:
我的解决方案是使用用于 ImageView 的矩阵来获取翻译,并且我还有该图像的比例。使用这两个我裁剪了原始图像。
My solution was to use the matrix that I used for the ImageView to get the translation and I also had the scale of that image. Using those two I cropped the original image.