如何采取截图编程? [英] How to take screenshot programmatically?
本文介绍了如何采取截图编程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要带一个全屏截图编程, 例如,Android主屏幕或菜单中的一个。 我怎样才能在主屏幕上的我的应用程序的视图? 我希望把它编程!的 没关系,如果它需要root模式!
I want to take a fullscreen screenshot programmatically , for example, one of the android home screen or a menu. How can I get a view of the home screen in my application? I want to take it programmatically!!! It doesn't matter if it requires root mode!
请帮助我对不起我的英语水平!
Help me please and sorry for my English!
推荐答案
使用下面的code
Bitmap bitmap;
View v1 = MyView.getRootView();
v1.setDrawingCacheEnabled(true);
bitmap = Bitmap.createBitmap(v1.getDrawingCache());
v1.setDrawingCacheEnabled(false);
下面MyView的是,通过它,我们需要包括在屏幕中查看。
Here MyView is the View through which we need include in screen.
这篇关于如何采取截图编程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文