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.
the problem is that I want to use the same image size as it is.
When I am trying to send the image by Mail app it says that actual size is 1MB when trying to convert the same image to bytes with UIImageJPEGRepresentation the Bytes length is more then 3MB.