[VM][BUG] losing alpha channel

Lex Spoon lex at cc.gatech.edu
Mon Jun 2 08:31:50 UTC 2003


asFormOfDepth: doesn't fixup the alpha chanel on conversion from 16 bits
to 32 bits.  Similarly, drawing a 16-bit form onto a Form using a
FormCanvas has the same problem.  Conversion from 8 bits to 32 bits has
no trouble.

What's up?  I notice a method called fixAlpha:with: with a very
suggestive comment, but I don't know how to use it.  I post this in the
hopes someone can suggest a one-line fix, before I delve deeper.

My image is 3.5-5174 , though non-standard changes may well have crept
in
My VM is Ian's 3.4 release



Lex


=====


form0 := ImageReadWriter formFromStream: 'http://www.squeakland.org/images/logo.jpg' asUrl retrieveContents contentStream.

form32 := form0  asFormOfDepth: 32.
form32 colorAt: 50 at 50    "transparent!!"

form32 := (Form extent: form0 extent depth: 32).
(FormCanvas on: form32) drawImage: form0 at: 1 at 1.
form32 colorAt: 50 at 50   "also transparent"


form32 := (form0 asFormOfDepth: 8) asFormOfDepth: 32.
form32 colorAt: 50 at 50   "this is fine -- the problem seems peculiar to 16->32 conversions"



More information about the Squeak-dev mailing list