我的Android相機正在將整個圖像傳遞到onPreviewFrame,但我只想要與像素範圍對應的字節。 例如,像素爲480x640的圖像通過。我想與在矩形的(100100200200)如何解析圖像字節[]數組
public void onPreviewFrame(byte[] arg0, Camera arg1) {
// arg0 = 460,800 BYTES
// the camera's resolution is at 640 x 480
// arg0 format is NV21
}
可能重複:http://stackoverflow.com/questions/9656350/android-camera-how-can-i-take-a-specific-rectangle-from-the-byte-陣列。你正在尋找的詞是「種植」。 – 2012-08-15 18:40:53
也http://stackoverflow.com/questions/9747295/crop-particular-part-of-image-in-android – 2012-08-15 18:41:18