What format does “adb screencap /sdcard/screenshot.raw” produce? (without “-p” flag)

后端 未结 3 1845
悲哀的现实
悲哀的现实 2021-02-09 05:54

I am looking to use adb screencap utility without the -p flag. I imagined output will be dumped in raw format, but doesn\'t look like it. My attempts o

3条回答
  •  终归单人心
    2021-02-09 06:15

    Thanks to the extract of your file , I guess your raw file is formated as width x height then the whole set of RGBA pixels (32 bits) (width x height times) Here I see you get a 720x1280 image captured..

    May the ImageMagick toolset help you to view/convert it in a more appropriate file format. Here below a sample that may help you (ImageMagick convert command, for osx see http://cactuslab.com/imagemagick/ )

    # skip header info  
    dd if=screenshot.raw of=screenshot.rgba skip=12 bs=1
    # convert rgba to png
    convert -size 720x1280 -depth 8 screenshot.rgba screenshot.png
    

    If it doesn't work you may try changing skip=12 by skip=8 and/or 720x1280 by 1280x720 ..

    Hope that help

提交回复
热议问题