Wednesday, February 5, 2014

Data dev/graphics/fb0 or dev/fb0 file is stored in the data look like? Is not binary


            
You master them, the procedure is the ape to write a program to read image data from two documents such as the title, but returned later with c reads the data to the data layer is found to be normal java convert bitmap, seems to be to get The data in question. Ask the experts, read out the data from these two files are not binary data, or the other types of data. . Seeking advice. dev/graphics/fb0 dev/fb0 inside or removed in the end what is the data. .
Reply:
The data is raw data, which is stored in the data format and the format you want to convert is not the same, I turn into ARGB_8888 format, paste the code
I deal
 
Get Screen Size:
DisplayMetrics metrics = new DisplayMetrics ();
WindowManager WM = (WindowManager) this.getSystemService (Context.WINDOW_SERVICE);
Display display = WM.getDefaultDisplay ();
display.getMetrics (metrics);
int height = metrics.heightPixels; / / screen high
Wide
/ / screen; int width = metrics.widthPixels
/ / Get the display mode
int pixelformat = display.getPixelFormat ();
PixelFormat localPixelFormat1 = new PixelFormat ();
PixelFormat.getPixelFormatInfo (pixelformat, localPixelFormat1);
int deepth = localPixelFormat1.bytesPerPixel ;/ / bit depth

InputStream stream = getInputStream ();
byte [] piex = new byte [height * width * deepth];
DataInputStream dStream = new DataInputStream (stream);
int i = 0;
while (dStream.read (piex, 0, height * width * deepth)! = -1) {
/ / Save the image
int [] colors = new int [height * width];
for (int m = 0; m if (m% 4 == 0) {
int r = (piex [m] & 0xFF);
int g = (piex [m +1] & 0xFF);
int b = (piex [m +2] & 0xFF);
int a = (piex [m +3] & 0xFF);
colors [m / 4] = (a << 24) + (r << 16) + (g << 8) + b;
}
}
/ / Piex generate bitmap
Bitmap bitmap = Bitmap.createBitmap (colors, width, height, Bitmap.Config.ARGB_8888);

/ / Bitmap saved as png format:
FileOutputStream out = new FileOutputStream ("/ mnt / sdcard / test" + x + "png.");
bitmap.compress (Bitmap.CompressFormat.PNG, 100, out);

Reply:
Er er. . Yes, I try. Thank you. . Sorry, did not reply for a long time, most recently in the busy else. . Ha ha. .
Reply:
reference to the second floor jizhuni_weixiao reply:
er er. . Yes, I try. Thank you. . Sorry, did not reply for a long time, most recently in the busy else. . Ha ha. .

The landlord realized it, I get is a black screen, and seek guidance
Reply:
I also get a black screen. . . .
Reply:
colors [m / 4] = (a << 24) + (r << 16) + (g << 8) + b;
If blank, then a change of position of each try their value or the like can be used pure red color which position to test the value of the deposit is r
Reply:
Why do I get the picture, mess, and is part of, part of, you can not get the whole screen
Reply:
Guixie landlord ah. . !
Reply:
Landlord, why do I get the picture, mess, and is part of, part of, you can not get the whole screen
Reply:
Seeking a full screenshot code under linux (
)
Reply:
To the code
c language
Reply:
Other phones can now why Samsung p3100 fb0 to get any data
Reply:
Black is because you do not have root access, search root relevant information.

No comments:

Post a Comment