How To Create a Scaling Image View in Android

Custom Scaling Image View

Images comes in all shapes and sizes.

If the Android apps tried to render a big resolution image, some device may throw an error like Android canvas is trying to draw large bitmap error.

The solution is to load large bitmap efficiently by loading the lower resolution version in the memory. We will resize the image. Below is a code example of scaling image view. It scale down the bitmap base on its measured width in the app UI.

Feel free to modify the code to fit into your project solutions.

Comments

Popular posts from this blog

CTF Practice - Reverse Engineering Android Apps 101

Real-world Applications of Computer Programming

Strengths and Weaknesses of iOS & Android