En mi web, el servicio de imágenes se almacenan en byteArray formato.quiero convertir la imagen de mapa de bits.

adjunto mi código aquí .

  BufferedInputStream bufferedInputStream = new BufferedInputStream(AndroidJSONParsingActivity.inputStream);
             Bitmap bmp = BitmapFactory.decodeStream(bufferedInputStream);
             ByteArrayOutputStream companylogo = new
             ByteArrayOutputStream();
             ImageView image=new ImageView(this);
             image.setImageBitmap(bmp);
InformationsquelleAutor Deepi | 2013-04-15

2 Comentarios

  1. 2
    Bitmap bitmap = BitmapFactory.decodeFile("/path/images.jpg");
    ByteArrayOutputStream blob = new ByteArrayOutputStream();
    bitmap.compress(CompressFormat.PNG, 0 /*ignored for PNG*/, blob);
    byte[] bitmapdata = blob.toByteArray();
    //if bitmapdata is the byte array then getting bitmap goes like this
    
    Bitmap bitmap = BitmapFactory.decodeByteArray(bitmapdata , 0, bitmapdata .length);
    Returns The decoded bitmap, or null if the image could not be decode.
  2. 1

    Probar este,

    //Camera arg conversion to Bitmap
    Bitmap background = BitmapFactory.decodeByteArray(Your_byte_array_image, 0,
                                Your_byte_array_image.length);
    Bitmap back = Bitmap.createBitmap(background.getWidth(),
                            background.getHeight(), Bitmap.Config.ARGB_8888);

    Utilizar este mapa de bits.

Dejar respuesta

Please enter your comment!
Please enter your name here