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)