artaaaw
artaaaw

Reputation: 1

How to Convert Hexe to ImageView in Android

String photoByte2 = "FFD8FFE000104A46494600010101000000000000FFE2021C4943435...." 

this is not whole hex code;



Bitmap bitmap = BitmapFactory.decodeByteArray(photoByte2.getBytes(), 0,photoByte2.length());
        img.setImageBitmap(bitmap);

i want convert above Base16 or Hex code to Image View in my android Project?but i dont have idea what can i do...

Upvotes: 0

Views: 345

Answers (1)

boompsy
boompsy

Reputation: 66

First convert your Hex to array of int (Int[]) and from that u can get bitmap by

bitmap=Bitmap.createBitmap(int[] intarray, int width, int height, Bitmap.Config config) 

Upvotes: 1

Related Questions