Posts

Showing posts from May, 2022

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.