How to make a crop camera view on SurfaceView Android

青春壹個敷衍的年華 提交于 2019-12-03 04:04:43

Check this tutorial. Displays a camera preview and a custom view than can define your region to be cropped, by dragging. You can modify it according to your needs. The only problems I could find are with orientation of the screen, that modify the preview, and of the resulting image.

http://adblogcat.com/a-camera-preview-with-a-bounding-box-like-google-goggles/

you need to save the bitmap picture before crop.

croppedBitmap = Bitmap.createBitmap(cameraBitmap, x,y, cameraBitmap.getWidth(), cameraBitmap.getHeight());

after you just overwrite to the same path of your original picture

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!