BitBlt>>pixelAt: does 0-based indexing?
Boris.Gaertner at gmx.net
Sun Jan 4 09:05:53 UTC 2004
From: Martin Kuball <MartinKuball at web.de> wrote:
> I'm trying to do some image processing in Squeak. I load an image into a
> and than use a BitBlt peeker to examine pixel values. After some hacking I
> noticed that the indexing is not 1-based as in other Smalltalk methods. Is
> this on purpose or a bug?
This is not a bug. In a Form, pixel coordinates run from
0 to: form width - 1 in the horizontal and from
0 to: form height - 1 in the vertical.
This is Smalltalk tradition, but it is not mentioned
very often. In the blue book, we read on page
383 (reprint of May 1983):
"A display object represents an image that has a width,
a height, an assumed origin at 0 @ 0, and an offset ..."
More information about the Squeak-dev