Praj
Praj

Reputation: 31

Getting out of memory exception on calling createScaledBitmap

I am getting an outofmemory error in spite of using softreferences and using the inSample size as the options. I get the error on calling createScaledBitmap. Any kind of pointers is highly appreciated.

Upvotes: 3

Views: 1192

Answers (1)

J.S. Taylor
J.S. Taylor

Reputation: 761

It would comsume a lot of memory if you use Bitmap.createScaledBitmap and scale bitmaps to huge size. Instead, try to keep your orginal bitmap and a scaled Matrix. Call Canvas.drawBitmap(bitmap, matrix, paint) to display it. Leading to lower image quality but better than crashing.

Upvotes: 2

Related Questions