fash866 Member Licensed User Longtime User Apr 14, 2015 #1 Hi! I used LoadBitmapSample to comprees a photo,and want to upload the compressed photo to http server , but httpUtils2 only support post bytes,is there any way to convert bitmap to byte[]? Or, is ther other way to compress a photo and upload it ?
Hi! I used LoadBitmapSample to comprees a photo,and want to upload the compressed photo to http server , but httpUtils2 only support post bytes,is there any way to convert bitmap to byte[]? Or, is ther other way to compress a photo and upload it ?
Erel B4X founder Staff member Licensed User Longtime User Apr 14, 2015 #2 B4X: Dim out As OutputStream out.InitializeToBytesArray(0) bmp.WriteToStream(out, 100, "PNG") out.Close Dim data() As Byte = out.ToBytesArray Upvote 0
B4X: Dim out As OutputStream out.InitializeToBytesArray(0) bmp.WriteToStream(out, 100, "PNG") out.Close Dim data() As Byte = out.ToBytesArray
fash866 Member Licensed User Longtime User Apr 17, 2015 #3 Erel said: B4X: Dim out As OutputStream out.InitializeToBytesArray(0) bmp.WriteToStream(out, 100, "PNG") out.Close Dim data() As Byte = out.ToBytesArray Click to expand... It's ok now, thanks ! Upvote 0
Erel said: B4X: Dim out As OutputStream out.InitializeToBytesArray(0) bmp.WriteToStream(out, 100, "PNG") out.Close Dim data() As Byte = out.ToBytesArray Click to expand... It's ok now, thanks !
G Ganiadi Active Member Licensed User Longtime User Dec 9, 2015 #4 Can anybody help, Im trying to get image file from tab and send it to the desktop server written using vb6. What im doing is convert the image to byte array and send it using socket stream astream.Write(data) Problem: My desktop server received the data correctly, but when i open the image file is corrupted. It seems the structure is incorrect. Tks Upvote 0
Can anybody help, Im trying to get image file from tab and send it to the desktop server written using vb6. What im doing is convert the image to byte array and send it using socket stream astream.Write(data) Problem: My desktop server received the data correctly, but when i open the image file is corrupted. It seems the structure is incorrect. Tks
Erel B4X founder Staff member Licensed User Longtime User Dec 9, 2015 #5 Please start a new thread for this question. Upvote 0