grow heap on load several bitmap- scale bitmap to screen size

  • Thread starter Android Central Question
  • Start date
A

Android Central Question

in my game i use surfaceview And Canvas to draw sprites on screen for achiving this in all screen size: i test two way:

first: when canvase want to draw Framebuffer(final bitmap) on screen, scale this framebuffer by using

canvas.drawBitmap(framebuffer, null, dstRect, paint);

but frame per second(fps) reduce And game dont run smooth( smaller screen = smoother game runing)

two: if i load And scale all photo in start of game accordindg to screen size --> Grow heap increase use this in this way:

canvas.drawBitmap(framebuffer, 0, 0, paint);

All of images are Maximum 480*800 pixel

(****an image without scale, allocate 1.5 mb And with scale for a 1080*1920 device allocate about 10mb *****)
 

Forum statistics

Threads
943,578
Messages
6,919,377
Members
3,159,105
Latest member
RebelSynn