Vincent, You do realise, that the values you showed in your example are half-bytes?
The problem you are trying to solve is not too hard. For each byte received keep detecting the leftmost bit using binary AND operator and appropriate mask. Once you detect 1 add 'black pixel bytes' into your traget byte array. Upon detecting 0 add 'white pixel bytes'. Then binary shift the source data left and repeat detecting the leftmost bit again. Do this in a loop. If your bytes have values 0-15 you will have to shift left by 4 positions before starting to analyse the input. Once your target byte array is ready, use BitmapFactory as suggested by Streets of Boston. HTH On Monday, 5 December 2011, Vincent <[email protected]> wrote: > Hi, > > I want to create images from binary data. > > e.g. > If the binary data is: > > 0110 1110 0011 1010 > 1000 0001 1011 1100 > 0110 1101 1111 0000 > 0100 0011 1001 0011 > > > which is store in 4*4 bytes > { > 6 14 3 10 > 8 1 11 12 > 6 13 15 0 > 4 3 9 3 > } > > I want to create a image(might be bitmap) from the binary data, > > if 1, draw a black pixel, if 0, draw a white pixel > so the image would be > .. ... ... . > . .. .... > .. .. ..... > . ... . .. > > And I will receive new data and refresh the image frequently. > > Could you give me some hints/suggestions? > > > > > Android 3.2 (API Level 13) > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

