我如何采取一个Android布局的屏幕截图? [英] how do i take a screenshot of an android layout?
本文介绍了我如何采取一个Android布局的屏幕截图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的问题是如何使用内置的屏幕捕获我采取截图。任何提示或样品code会大大AP preciated。
my question is how do I take a screenshot using the built in screen capture. Any hints or sample code would be greatly appreciated.
推荐答案
有两种方法可以尝试,
- 使用Eclipse
打开设备视图在Eclipse(窗口菜单 - >显示视图选项 - >其他,机器人 - >设备),并有右侧标有一个工具栏按钮屏幕捕获
Open the Devices view in Eclipse ( Window Menu --> Show View Option --> Other, Android --> Devices), and there's a toolbar button on the right side labeled Screen Capture
-
采用Android code
Using Android Code
Bitmap bitmap;
View v1 = MyView.getRootView();
v1.setDrawingCacheEnabled(true);
bitmap = Bitmap.createBitmap(v1.getDrawingCache());
v1.setDrawingCacheEnabled(false);
这篇关于我如何采取一个Android布局的屏幕截图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文