On 11.06.2014, at 00:36, Sungjin Chun wrote:
> Hi,
>
> I want to draw gray scale bitmap using byte array which has pixel by pixel
> gray
> scale value as byte like this;
>
> [0 0 0 0 0 0 0 0
> 16 23 255 78 12 12 12 12
> ...
> ...] (8x4 for example)
>
> I can draw this using Pen class pixel b
Form has some class side methods to create Forms from arrays, too.
Cheers,
Karl
On Wed, Jun 11, 2014 at 12:41 PM, Bert Freudenberg
wrote:
> On 11.06.2014, at 00:36, Sungjin Chun wrote:
>
> > Hi,
> >
> > I want to draw gray scale bitmap using byte array which has pixel by
> pixel gray
> > sca
Thanks you for your answer, however there is something I missed here.
I've tried following code
| w h bytes form |
w := 200.
h := 200.
bytes := ((1 to: w*h) collect: [:i | 255 ]) asByteArray.
(1 to: w) do: [ :x |
(1 to: h) do: [ :y |
x = y ifTrue: [ bytes at: (w*(y - 1) + x) put: 0 ]