Bitmap accessing

Bob Arning arning at charm.net
Sun Jun 17 15:02:53 UTC 2001


Karl,

Bitmaps contain 32-bit integers. If the Form is 8 or 16 bits deep, then one word in the Bitmap contains the data for 4 or 2 pixels. Accessing these pixels requires shifting and masking to get the appropriate portion of the 32-bit word.

Cheers,
Bob

On Sun, 17 Jun 2001 15:54:12 +0200 Karl Ramberg <karl.ramberg at chello.se> wrote:
>pixels _ newImage form bits.
>oldBits _ oldForm bits.
>largeness _ oldBits size.
>d _ oldForm depth.
>1 to: largeness do:[:c| i _ oldBits at: c.
>     oldpixel _ Color colorFromPixelValue: i depth: d.
>     pixels at: c put: (oldpixel pixelValueForDepth: d)]
>
>It works as expected in 32 bits depth but in 16 or 8
>bits I get vertical stripes of transparency...
>
>Anybody know why ?





More information about the Squeak-dev mailing list