Hi i am working on android application to detect page number using camera preview. After I received frame I draw a rectangle on surface view Using Canvas and I want to crop the rectangle area to put it in a bitmap, so please how can I do it ?
If you have the bitmap of the frame, you can use
Bitmap croppedBmp = Bitmap.createBitmap(originalBmp, rectanglePositionX, rectanglePositionY, rectangleWidth, rectangleHeight);
Assuming you know where your rectangle is positioned and its dimensions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With