android framebuffer adb pull

本文介绍了如何通过ADB命令读取Android设备的帧缓冲区(framebuffer),以获取屏幕分辨率、颜色位深(BPP)等参数,并提供了测试命令及输出示例。

1. 读取设备的framebuffer,最简单的方式是通过 adb

adb shell

cd /dev/graphics

cat fb0 > screen   ;得到当中主屏幕的内容

你可以切换屏幕,然后将之前暂存的屏幕内容写入到当前主屏幕当中,其显示的内容是之前的内容

cat screen > fb0

2. 得到本身机器的framebuffer的格式,可以使用系统自带的 test-fb-refresh bin,

其的源代码在pizza/system/extras/tests/framebuffer目录下面

执行的结果

using (fd=3)
id           = fb0
xres         = 2048 px
yres         = 1536 px
xres_virtual = 2048 px
yres_virtual = 1536 px
bpp          = 16
r            = 16:8
g            =  8:8
b            =  0:8
width        = 216 mm (240.829620 dpi)
height       = 135 mm (288.995544 dpi)
refresh rate = 56.30 Hz
upper_margin=9, lower_margin=3, left_margin=5, right_margin=150, pixclock=5208, finfo.smem_len=37748736
refresh rate = 27562.446167 Hz
refresh rate = 23961.063272 Hz
refresh rate = 28283.542514 Hz

3. 发现launche与mylauncher其的界面与fb不一样。

 

4. linux RGB像素格式

Name

Packed RGB formats — Packed RGB formats

Description

These formats are designed to match the pixel formats of typical PC graphics frame buffers. They occupy 8, 16, 24 or 32 bits per pixel. These are all packed-pixel formats, meaning all the data for a pixel lie next to each other in memory.

http://stackoverflow.com/questions/16748100/how-to-programmatically-determine-bpp-and-pixel-color-format-of-android-screen

How to programmatically determine bpp and pixel color format of android screen?

http://stackoverflow.com/questions/16748100/how-to-programmatically-determine-bpp-and-pixel-color-format-of-android-screen

转载于:https://www.cnblogs.com/pengxinglove/p/5537805.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值