[squeak-dev] error inBitBlt with ColorForm

Hans-Martin Mosner hmm at heeg.de
Sun Sep 6 19:17:11 UTC 2009


Martin Kuball schrieb:
> Hi!
>
> I'm creating a ColorForm like this:
>
> 	bits := Bitmap new: image size / 4.
> 	bits copyFromByteArray: image.
> 	form := ColorForm extent: self area extent depth: 8 bits: bits.
> 	form colors: self colorMap.
>
> where area is a Rectangle instance and image is a ByteArray with some 
> computed image data.
>   
Your "image" data probably does not include padding.
In Squeak, the bits of a form need to be properly padded to a multiple
of 32 bits.
So if your image is not a multiple of 4 pixels wide, you need to include
appropriate padding after each scanline.

Cheers,
Hans-Martin



More information about the Squeak-dev mailing list