androidScreenshotClient接口截屏幕

he library you need is called libsurfaceflinger_client.so. You can pull it from any device running Gingerbread or higher version of Android, with command

創(chuàng)新互聯(lián)主要從事成都網(wǎng)站設(shè)計(jì)、網(wǎng)站制作、網(wǎng)頁(yè)設(shè)計(jì)、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)松北,十余年網(wǎng)站建設(shè)經(jīng)驗(yàn),價(jià)格優(yōu)惠、服務(wù)專業(yè),歡迎來(lái)電咨詢建站服務(wù):028-86922220

adb pull/system/lib/libsurfaceflinger_client.so

On ICS or JB, class ScreenshotClient is part of libgui.so. The makefile for screencap which is the example of using ScreenshotClient, suggests that linker may need other libraries:

libcutils libutils libbinder libskia libui libgui

Also, the code of screencap.cpp goes as follows:

ScreenshotClient screenshot;if(screenshot.update()== NO_ERROR){base= screenshot.getPixels();    w= screenshot.getWidth();    h= screenshot.getHeight();    f= screenshot.getFormat();    size= screenshot.getSize();}else{constchar* fbpath="/dev/graphics/fb0";int fb= open(fbpath, O_RDONLY);if(fb>=0){struct fb_var_screeninfo vinfo;if(ioctl(fb, FBIOGET_VSCREENINFO,&vinfo)==0){...

This means that at least you must check that update() succeed. Unfortunately, unless teh device is rooted, the apps cannot be granted permission to read from /dev/graphics/fb0 and use the fallback of /system/bin/screencap or /system/bin/screenshot.

問(wèn)題產(chǎn)生鏈接

http://stackoverflow.com/questions/12560957/how-to-use-screenshotclient-in-my-android-application

代碼閱讀鏈接

http://code.metager.de/source/xref/android/4.0.3/

android sdk java源碼

http://grepcode.com/snapshot/repository.grepcode.com/java/ext/com.google.android/android/4.4.2_r1/

相關(guān)鏈接

http://blog.sina.com.cn/s/blog_69a04cf4010173fz.html

文章標(biāo)題:androidScreenshotClient接口截屏幕
分享網(wǎng)址:http://muchs.cn/article2/ghsdic.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供移動(dòng)網(wǎng)站建設(shè)、云服務(wù)器App開(kāi)發(fā)、Google、全網(wǎng)營(yíng)銷推廣、服務(wù)器托管

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

成都網(wǎng)站建設(shè)