With root privileges on the phone, can be shot
by "/ dev/graphics/fb0"
The code is roughly as follows
FileInputStream in = new FileInputStream ("/ dev/graphics/fb0");
DataInputStream ds = new DataInputStream (in);
ds.readFully (piex);
for (int m = 0; m
int g = (piex [m * 4 + 1] & 0xFF);
int r = (piex [m * 4 + 2] & 0xFF);
int a = (piex [m * 4 + 3] & 0xFF);
colors [m] = (a << 24) + (r << 16) + (g << 8) + b;
}
return Bitmap.createBitmap (colors, screenWidth, screenHeight, Bitmap.Config.ARGB_8888);
Normal shots but found some mobile phones, some cell phone shot the video, and some cell phone shots chromatic aberration. . .
What judgment processing
can seek expert guidance of how generic shots, or an extra plus
Shake when the QQ screenshot generic. . . I do not know is not achieved through jni. . .
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
I have come to learn
Reply:
Landlord to solve it?
Reply:
Favor, encountered the same problem.
Reply:
fb0 RAW data within each device is not the same
Try this
public ImageIcon getImageIcon (String targetNum) {
try {
/ / Long start = System.currentTimeMillis ();
RawImage rawImage = device.getScreenshot ();
/ / Long end = System.currentTimeMillis ();
/ / System.out.println ("get screen time:" + (end - start) + "- ms");
BufferedImage image = new BufferedImage (rawImage.width,
rawImage.height, BufferedImage.TYPE_INT_RGB);
int index = 0;
int IndexInc = rawImage.bpp >> 3;
for (int y = 0; y for (int x = 0; x int value = rawImage.getARGB (index);
index + = IndexInc;
image.setRGB (x, y, value);
}
}
return new ImageIcon (image);
} Catch (Exception e) {
e.printStackTrace ();
}
return null;
}
Reply:
If it is full-screen screenshot, rather than cut an area, then, android provides a screenshot screencap screenshot two commands, you can look if you use the
No comments:
Post a Comment