Android的 - 保存的ImageView与全分辨率图像到文件 [英] Android - Save ImageView to file with full resolution image

查看:100
本文介绍了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).

任何想法?

推荐答案

我的解决办法是使用我用于ImageView的得到转换矩阵,我也有这样的图像的规模。使用这些两个I裁剪的原始图像

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.

Bitmap resizedBitmap = Bitmap.createBitmap(
                        BitmapFrontCover, (int) UpperLeftCornerX,
                        (int) UpperLeftCornerY, (int) CropWidth,
                        (int) CropHeight);

这篇关于Android的 - 保存的ImageView与全分辨率图像到文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆