Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- File file = new File(imgfilepath);
- if(file.exists()&&file.canRead())
- {
- try{
- bitmap = BitmapFactory.decodeFile(imgfilepath);
- }catch(Exception e)
- {
- error=1;
- }
- try{
- blob = new ByteArrayOutputStream();
- }catch(Exception e)
- {
- error=2;
- }
- try{
- bitmap.compress(Bitmap.CompressFormat.JPEG,1, blob);
- }catch(Exception e)
- {
- error=3;
- }
- try{
- bitmapdata = blob.toByteArray();
- }catch(Exception e)
- {
- error=4;
- }
- }
Add Comment
Please, Sign In to add comment