Skip to content

Instantly share code, notes, and snippets.

View thanhcs94's full-sized avatar
🏠
Working from home

ThanhCS94 thanhcs94

🏠
Working from home
View GitHub Profile
@thanhcs94
thanhcs94 / PictureCallback.java
Created November 11, 2015 10:44 — forked from tomoima525/PictureCallback.java
Android code to make jpeg picture that fits with camera preview size
PictureCallback jpegCallback=new PictureCallback(){
@Override
public void onPictureTaken(byte[] data, Camera camera) {
if(data !=null){
/* I use Galaxy S3 and Supported PictureSize was width = 3264px, height = 2448px, prop = 1.3333334
Because inSampleSize should be integer, I set maxSize a fraction of srcSize(Supported Picturesize)
*/
int maxSize = 816;
mCamera.stopPreview();