【发布时间】:2017-04-18 22:51:44
【问题描述】:
我使用 PhotoView 库:https://github.com/chrisbanes/PhotoView
这是我最初的案例;它是 PhotoView 组件(红色方块);背景是透明的。我在里面加载了一张标准图片。
现在,我想将可见位图部分提取到另一个位图:
Bitmap original = mPhotoView.getVisibleRectangleBitmap();
return Bitmap.createBitmap(original, 0, 0, original.getWidth(), original.getHeight(),
mPhotoView.getImageMatrix(), true);
但结果很糟糕,因为有黑色区域,我不知道为什么......我只想提取有图片的区域而不是所有的PhotoView。
如何在不使用背景的情况下提取?
非常感谢你们!
【问题讨论】:
标签: android bitmap android-photoview