我申请的彩色滤光片到的ImageView并试图获得来自ImageView的位图。
ColorFilter filter = new LightingColorFilter(0x000000, myColor);
image_view.setColorFilter(filter);
Bitmap bitmap = ((BitmapDrawable)image_view.getDrawable()).getBitmap();
但该位图不会再让我应用了彩色滤光片,我只得到原始图像的位图。
下面是重复的职位要求,但它不是有用:
我理解了它终于来了!
我们需要做以下的事情来获得与应用上彩色滤光片的位图。
image_view.setDrawingCacheEnabled(true);
Bitmap bitmap = Bitmap.createBitmap(image_view.getDrawingCache());
希望这将有助于挣扎的人喜欢我。