Android 屏幕截图

1.同时按下电源键+音量下键截屏

PhoneWindowManager.java

View Code

TakeScreenshotService.java

View Code

GlobalScreenshot.java

View Code

SurfaceControl.java

View Code

android_view_SurfaceControl.cpp

View Code

SurfaceComposerClient.cpp

View Code

SurfaceFlinger.cpp

View Code

2.基于framebuffer显存设备/dev/graphics/fb0截屏

a.自带工具screencap:screencap.cpp

View Code

b.DDMS

ScreenShotDialog.java

View Code

Device.java

View Code

AdbHelper.java

View Code

services.c

View Code

sysdeps.h

View Code

framebuffer_service.c

View Code

c.screenshot2:Screenshot.java

View Code

3.robotiumScreenshotTaker.java

View Code

GLRenderWrapper.java

WebViewClassic.java

View Code

WebView.cpp

View Code

Graphics.cpp

View Code

CafeSnapshotHelper.java使用了除wrapper外相同的调用方法;

同样还有去除状态栏给Android设备屏幕截图

4.UiDevice.takeScreenshot (File storePath)/takeScreenshot (File storePath, float scale, int quality)

UiDevice.java

View Code

UiAutomatorBridge.java

View Code

UiAutomation.java

View Code

UiAutomationConnection.java

View Code

可以看到,绕来绕去又回到方法1了。

posted on 2013-08-25 19:14  农夫山药  阅读(2498)  评论(0编辑  收藏  举报