Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Convert Bitmap to ParseFile in android

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 1.12k
    Comment on it

    Hi,

    I am writing my method that convert Bitmap to ParseFile that we need to upload image on parse.com server.

    Below is the method in which we just pass our bitmap of image and we get ParseFile.

    We use ByteArrayOutputStream then convert it to png.


    public ParseFile conversionBitmapParseFile(Bitmap imageBitmap){
      ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream();
      imageBitmap.compress(Bitmap.CompressFormat.PNG,100,byteArrayOutputStream);
      byte[] imageByte = byteArrayOutputStream.toByteArray();
      ParseFile parseFile = new ParseFile("image_file.png",imageByte);
      return parseFile;
    }

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: