Form manipulation from a Plugin

Andreas Raab andreas.raab at
Mon Apr 7 17:08:28 UTC 2003


> But I still don't find the way to get the alpha part of 
> pixel. With this code:
>    alpha := (pixel bitAnd: 16rFF000000) >> 24.
> alpha is always 0.  Is It the way to get the alpha part for 
> pixels in 32 bits Forms?

The code is correct. If you don't see any alpha in those pixels there's a
good chance that the form does not include alpha. Note that this may happen,
for example, when you blt 16 to 32bpp forms (this is a ... hm ... sorta
bug/optimization in BitBlt).

Oh, just thinking about it - you may have a problem with the above due to
signed/unsigned shifts in C. Try something like:

	alpha := (pixel >> 24) bitAnd: 255.

(which will make sure you get a positive integer).

  - Andreas

More information about the Squeak-dev mailing list