Back to project page SecNote.
The source code is released under:
Apache License
If you think the Android project SecNote listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.baraccasoftware.securenotes.object; //ww w.j a v a2 s .c om import android.graphics.Bitmap; import android.graphics.BitmapFactory; import java.io.ByteArrayOutputStream; /** * Created by angelo on 28/02/14. */ public class BitmapUtility { public static Bitmap decodeFile(String path){ BitmapFactory.Options op = new BitmapFactory.Options(); op.inSampleSize = 2; return BitmapFactory.decodeFile(path,op); } public static byte[] compressBitmap(Bitmap toCompress, int quality) throws Exception{ ByteArrayOutputStream stream = new ByteArrayOutputStream(); byte[] byteC; //qualit della foto 45 --- 50 toCompress.compress(Bitmap.CompressFormat.JPEG, quality, stream); byteC = stream.toByteArray(); return byteC; } }