View Single Post

Default 

August 26th, 2013, 04:03
Got some of the memory under control. Instead of a background Drawable scaling itself to the dimensions of a Weapon Button I changed the button to a standard ImageView.

I then scrape the ImageView for its height and width, then create a Bitmap from the image resource, scale it to those dimensions then make it the image of the new view.

the result



you'll notice aspect ration stays intact compared the image above.

On top of this I declared only one Bitmap for the entire Activity and recycle and gc it just before I set the new value.

So far I've stressed it and at the worst it seems to get about 21mb. So far so good but I would like to get it better.

edit: scaling fixed, with no noticeable change in memory
invisfixed.png

Developer of The Wizard's Grave Android game. Discussion Thread:
http://www.rpgwatch.com/forums/showthread.php?t=22520
Last edited by Lucky Day; August 26th, 2013 at 05:40.
Lucky Day is offline

Lucky Day

Lucky Day's Avatar
Daywatch

#80

Join Date: Oct 2006
Location: The Uncanny Valley
Posts: 3,199