Android: Scrollable (bitmap) screen

Posted by somin on Stack Overflow See other posts from Stack Overflow or by somin
Published on 2011-02-11T12:15:06Z Indexed on 2012/04/10 17:29 UTC
Read the original article Hit count: 139

Filed under:
|
|

I am currently implementing a view in Android that involves using a larger than the screen size bitmap as a background and then having drawables drawn ontop of this. This is so as to simulate a "map" that can be scrolled horizontally aswell as vertically.

Which is done by using a canvas and then drawing to this the full "map" bitmap, then putting the other images on top as an overlay and then drawing only the viewable bit of this to screen.

Overriding the touch events to redraw the screen on a scroll/fling.

I'm sure this probably has a huge ammount of overhead (by creating a canvas of the full image whilst using(drawing) only a fifth of it) and could be done in a different way as to the explained, but I was just wondering what people would do in this situation, and perhaps examples?

If you need more info just let me know,

Thanks,

Simon

© Stack Overflow or respective owner

Related posts about android

Related posts about scrolling