Thanks for replying, I think I didn't describe my needs clearly. What I want are: 1. Use 30 bytes to represent one line 2. One byte has 8 bits, each bit to represent one pixel. 3. So one line has 240 (30x8) pixels. 4. If a bit's value is 0, set a pixel to black 5. If 1, set a pixel to white 6. I have 120 lines to draw. 7. I need to update each line very often.
So, not if one bit is 0, then draw a black line. And for expanding the encoding, could you give any hint? Thank you. On Dec 4, 12:28 pm, James Black <[email protected]> wrote: > You will need to expand the encoding you have and then it would seem the > best approach is to have a white background, then just draw a line > (http://stackoverflow.com/questions/3616676/how-to-draw-a-line-in-android) > for the black lines, so, you would need to find the start of the current > line segment, see how many pixels in that segment, then draw the line, then > skip over the white ones (that would be like drawing a white line) and draw > the next black line segment. > > > > > > > > > > On Sat, Dec 3, 2011 at 7:34 PM, Vincent <[email protected]> wrote: > > Hi, > > > I want to draw an image from bytes. E.g. I have a byte "01111010", a > > black pixel for a 0, a white pixel for a 1, then I need draw an 8 > > pixels line "black white white white white black white black white" on > > the screen. > > > I have about 3000 bytes (30 bytes per line)to draw an image, and I > > need to update the image frequently. > > > Could you give any suggestion? Is Bitmap.createBitmap from colors > > array applicable? > > > Android 3.2 > > > -- > > 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 > > -- > "I know that you believe you understand what you think I said, but I'm not > sure you realize that what you heard is not what I meant." > - Robert McCloskey -- 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

