Note that there are some explanatory texts on larger screens.

plurals
  1. POHorrible ImageView bitmap quality?
    primarykey
    data
    text
    <p>I've got a splash screen with an <code>ImageView</code> playing the part of a background. Regardless of whether or not I allow my bitmap to be scaled (which I do), the image quality is horrible. I think it's reducing the color depth. I've looked around SO already and one suggestion was to place my image in <code>raw</code> instead of <code>drawable</code> but that didn't help either. Here is a screenshot:</p> <p><img src="https://i.stack.imgur.com/fU4JA.png" alt="enter image description here"></p> <p>What exactly is going on here and how do I fix it?</p> <p>EDIT: I didn't apply this bitmap programmatically so there's no relevant Java code. Here is the XML code for this activity:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/RelativeLayoutSplash" android:layout_width="match_parent" android:layout_height="match_parent" android:drawingCacheQuality="high" android:orientation="vertical" android:padding="@dimen/splash_padding" android:scrollbarAlwaysDrawVerticalTrack="true" tools:context=".SplashActivity" &gt; &lt;ImageView android:id="@+id/ImageViewBg" android:layout_width="match_parent" android:layout_height="match_parent" android:contentDescription="@string/logo_description" android:scaleType="centerCrop" android:src="@drawable/splash_bg_register" /&gt; &lt;ImageView android:id="@+id/ImageViewLogo" android:layout_width="match_parent" android:layout_height="wrap_content" android:contentDescription="@string/logo_description" android:maxHeight="@dimen/logo_maxheight" android:maxWidth="@dimen/logo_maxwidth" android:layout_centerVertical="true" android:src="@drawable/logo" /&gt; &lt;TextView android:id="@+id/TextViewCopyright" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:text="@string/copyright" android:textAppearance="?android:attr/textAppearanceSmall" android:textColor="@color/white_50" android:textSize="@dimen/copyright_size" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p>EDIT: I tried <code>getWindow().setFormat(PixelFormat.RGBA_8888);</code> as suggested which made a visible difference but the banding is still present. <a href="http://goo.gl/oSHrp" rel="nofollow noreferrer">This</a> is the image I'm using as the background.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload