Hi,
When I try to draw pixels like this:
short[] data = new short[2568];
drawPixels(data, false, 0, 16, 0, 0, 16, 16, 0, DirectGraphics.TYPE_USHORT_444_RGB);
it works, but with
drawPixels(data, false, 200, 16, 0, 0, 16, 16, 0, DirectGraphics.TYPE_USHORT_444_RGB);
it gives an IllegalArgumentException: invalid offset | scanline
Why? The array should be large enough...
It seems that the offset should be a multiple of the length of scanline. Offsets 0,16, 32 and so on work. However, this makes no sense as it is said in the api docs that the formula is:
P(x1, y1) = pixels[offset + (x1 - x) + (y1 - y) * scanlength],
for each P(x1, y1), where (x <= x1 < x + width) and (y <= y1 < y + height).
I also tested it on a 6610, and it had similar behavior.
How am I supposed to store multiple images with different widths (scanline widths)? I hope the cliprect works properly with drawPixels so that I won't need to do the manual clipping...
BTW, The emulator works like a charm. It seems to follow the formula presented in the docs.
Thanks.

Reply With Quote

