android - I want code to capture 24fps in my app, any suggestions...? -
i'm trying capture 24fps of rootview of screen. need code execute this. i've tried normal method capture screen capturing 24fps @ time slows down app alot. there method so, if yes please post me answer.
as mechanism isn't built-in feature, won't able nice 24fps.
being said, try following , see how fps get:
public class continuousscreenshottask extends asynctask<void, bitmap, void> { view view; context context; bitmap bitmap; canvas canvas; public continuousscreenshottask(view view) { this.view = view; this.context = this.view.getcontext().getapplicationcontext(); bitmap = bitmap.createbitmap(view.getwidth(), view.getheight(), bitmap.config.argb_8888); canvas = new canvas(bitmap); } @override protected void doinbackground(void... params) { while (!iscancelled()) { view.draw(canvas); savebitmap(context, bitmap); } return null; } @override protected void onprogressupdate(bitmap... values) { super.onprogressupdate(values); // more on ui thread? } }
i managed 20 fps without saving bitmap internal storage, , 3 fps when enabling saving.
maybe share method , see how can improved.
Comments
Post a Comment