Note that there are some explanatory texts on larger screens.

plurals
  1. POXml scale animation of ImageView makes the image aliased
    primarykey
    data
    text
    <p>I have a little xml animation that animates few ImageViews inside my layout. Actually it is the wavescale animation from the api demos sdk example. This animation scales the image up and then down to its original size so it looks sort of wave. The problem is when the image is upscaled it looks very bad, the edges are aliased and the image is blocky. My animation looks like this:</p> <pre><code>&lt;set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_interpolator"&gt; &lt;alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="100" /&gt; &lt;scale android:fromXScale="0.5" android:toXScale="1.25" android:fromYScale="0.5" android:toYScale="1.25" android:pivotX="50%" android:pivotY="50%" android:duration="200" /&gt; &lt;scale android:fromXScale="1.25" android:toXScale="1.0" android:fromYScale="1.25" android:toYScale="1.0" android:pivotX="50%" android:pivotY="50%" android:startOffset="200" android:duration="100" /&gt; &lt;/set&gt; </code></pre> <p>I tried, instead of loading the image directly in the src of the ImageView, to wrap it in a xml bitmap element and enable antialiasing and filtering but it makes no difference.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/myimage_img" android:antialias="true" android:filter="true" android:tileMode="disabled" /&gt; </code></pre> <p>And my ImageView looks like this:</p> <pre><code>&lt;ImageView android:src="@drawable/myimage" android:layout_height="wrap_content" android:layout_margin="5dp" android:adjustViewBounds="true" android:layout_width="fill_parent" android:scaleType="centerInside"&gt;&lt;/ImageView&gt; </code></pre> <p>Please also note that the image is not really upscaled. The image itself is bigger that it appears on the screen. It is centered inside the ImageView. But looks like the animation is not using the original image to render it with different size, but using the downscaled image from the ImageView and scaling it up again.</p> <p>Can you please help me to make my image appear smooth when it is animated?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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.
    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