Android Question How to convert bitmap to byte[] ?

Discussion in 'Android Questions' started by fash866, Apr 14, 2015.

  1. fash866

    fash866 Member Licensed User

    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 ?
  2. Erel

    Erel Administrator Staff Member Licensed User

    Dim out As OutputStream
    Dim data() As Byte = out.ToBytesArray
    DonManfred and Peter Simpson like this.
  3. fash866

    fash866 Member Licensed User

    It's ok now, thanks !
  4. Ganiadi

    Ganiadi Member Licensed User

    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

    My desktop server received the data correctly, but when i open the image file is corrupted.
    It seems the structure is incorrect.

  5. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for this question.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice