I have a strange problem with an ImageView. I have a partially transparent image with a gradient inside an ImageView. When it renders on the screen, it has banding artifacts in the gradient. Now, I also happen to render it during an animation using this code:
public static Bitmap capture(View view) {
view.setDrawingCacheEnabled(true);
Bitmap bitmap = view.getDrawingCache(true);
bitmap = Bitmap.createBitmap(bitmap);
view.setDrawingCacheEnabled(false);
return bitmap;
}
When I render it that way, the banding artifacts disappear! Any ideas how to get rid of the banding on the regular ImageView?
For completeness, the xml code used to create the ImageView looks like
<ImageView android:id="@+id/review_empty_list_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="10dp"
/>
I'm populating the image in code using ImageView.setImageResource(int)
The image is a partially transparent image with 24 bit color depth.