Hi,
I am using this Sub to convert a bitmap to bytes.
The strange thing is for a Image of 1MB after converting to bytes it become 3.4MB
Can someone check it please and advise a solution. Thank you.
I am using this Sub to convert a bitmap to bytes.
B4X:
Sub BitmapToBytes(Image As Bitmap) As Byte()
Dim out As OutputStream
Dim bb() As Byte
out.InitializeToBytesArray(0)
Image.WriteToStream(out,100,"JPEG")
out.Close
bb=out.ToBytesArray
Log(bb.Length)
Return bb
End Sub
The strange thing is for a Image of 1MB after converting to bytes it become 3.4MB
Can someone check it please and advise a solution. Thank you.