0

I have bad image quality after image scaling 2 times bigger. Is there any way to keep its quality? Without scaling it looks great.

I tried to increase image dimensions but with no affect.

java code:

ImageView imgView = findViewById(R.id.image_1);
Animation scaleAnimation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.scale);
scaleAnimation.setFillAfter(true);
imgView.startAnimation(scaleAnimation);

scale.xml code:

    <scale
        android:duration="200"
        android:fromXScale="1.0"
        android:fromYScale="1.0"
        android:pivotX="0%"
        android:pivotY="0%"
        android:toXScale="2.0"
        android:toYScale="2.0">
    </scale>
Tonton
  • 113
  • 2
  • 9

1 Answers1

0

Try to use svg file format for the drawable. It can scale to any size without losing quality.

Or double the height and width values of the ImageView at your xml layout then change the scaleX and scaleY values to 0.5 on your activity's onCreate to change the size to its normal size. And you can double its size without losing quality.

Community
  • 1
  • 1
Dan
  • 28
  • 3