0

I want a way to resize png icon inside Android Studio, so that I have not resize it from external source. Please note I am not talking about to code. I want resize png icon. (Like 100*100 to 50*50)

Any plugin/ In AS way you know about?

Khemraj Sharma
  • 57,232
  • 27
  • 203
  • 212

1 Answers1

1

If you mean resizing in code, then you need to get a bitmap from either bitmap drawable / resource stream directly.

Bitmap.createScaledBitmap(yourBitmap, yourWidth, yourHeight, false)

This will scale your bitmap.

If you wanted to get different image size for different density, you are looking for https://plugins.jetbrains.com/plugin/7658-android-drawable-importer, which allows you to batch import your image file and scale your image into different sizes for different dpi.

If you are looking for editing to raw png size, you need to use external tools.

Kit Mak
  • 231
  • 2
  • 4