Re: [android-developers] How to draw pixels?

2011-12-03 Thread James Black
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  wrote:

> Hi,
>
> I want to draw an image from bytes. E.g. I have a byte "0010",  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 android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] How to draw pixels?

2011-12-03 Thread Vincent
Hi,

I want to draw an image from bytes. E.g. I have a byte "0010",  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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en