performance - Android drawing to bitmap canvas slow -
scenario have imageview fills phone screen. every based on touch events draw offscreen bitmap , display on imageview.
code display is
bitmap b = bitmap.createbitmap(globals.screenwidth,globals.screenheight, bitmap.config.argb_8888); canvas canvas = new canvas(b);
then bunch of paint settings, drawrects, , font outputs.
once bitmap/canvas updated show onscreen calling
imageview iv = (imageview)findviewbyid(r.id.mainview); iv.setimagebitmap(b);
this works slow. there not lot of drawrects , font updates (maybe @ 100 drawrects , 5 or 6 lines of text), can take 400 ms draw. when should seem instant user when touch screen.
any other ways of getting offscreen bitmap and/or canvas display fast onscreen?
Comments
Post a Comment