4

I need to crop every frame from the camera's onPreviewFrame. I want to crop it directly doing operations with the byte array without converting it to a bitmap. The reason I want to do it directly on the array is because it can't be too slow or too expensive. After the crop operation I will use the output byte array directly so I don't need any bitmap conversion.

int frameWidth;
int frameHeight;    

@Override
public void onPreviewFrame(byte[] data, Camera camera) {
    // Crop the data array directly.

    cropData(data, frameWidth, frameHeight, startCropX, startCropY, outputWidth, outputHeight);

}
fadden
  • 48,613
  • 5
  • 104
  • 152
stanete
  • 3,714
  • 9
  • 19
  • 28
  • Are you asking for help with code you've written, or asking for someone to write code for you? If the former, show what you've tried and explain what doesn't work. If the latter, you might be in the wrong place. – fadden May 03 '16 at 00:24

0 Answers0