Hi all,
I'm trying to fill areas on a Form object with different TranslucentColors using Form fill:fillColor:, however the areas always get filled with solid colours, ignoring the alpha values altogether. I've tried the different fill modes with no success. The form is initialised with a 32 bit depth. Any ideas?
I'm using Squeak 2.8 (I think… it's the MIT Scratch image).
Cheers, Jonathan
On 28 September 2011 07:14, Jonathan Mullins j.mullins@gmx.com wrote:
Hi all, I'm trying to fill areas on a Form object with different TranslucentColors using Form fill:fillColor:, however the areas always get filled with solid colours, ignoring the alpha values altogether. I've tried the different fill modes with no success. The form is initialised with a 32 bit depth. Any ideas?
it depends how you displaying a form. if you using drawImage: then alpha channel is ignored completely, and if you using translucentImage: ... then it blends with background.
I'm using Squeak 2.8 (I think… it's the MIT Scratch image). Cheers, Jonathan
Thanks guys,
Igor this fixed the problem, I was using paintImage instead of translucentImage.
Jonathan
On 28/09/2011, at 7:53 PM, Igor Stasenko wrote:
On 28 September 2011 07:14, Jonathan Mullins j.mullins@gmx.com wrote:
Hi all, I'm trying to fill areas on a Form object with different TranslucentColors using Form fill:fillColor:, however the areas always get filled with solid colours, ignoring the alpha values altogether. I've tried the different fill modes with no success. The form is initialised with a 32 bit depth. Any ideas?
it depends how you displaying a form. if you using drawImage: then alpha channel is ignored completely, and if you using translucentImage: ... then it blends with background.
I'm using Squeak 2.8 (I think… it's the MIT Scratch image). Cheers, Jonathan
-- Best regards, Igor Stasenko.
On 27.09.2011, at 22:14, Jonathan Mullins wrote:
Hi all,
I'm trying to fill areas on a Form object with different TranslucentColors using Form fill:fillColor:, however the areas always get filled with solid colours, ignoring the alpha values altogether. I've tried the different fill modes with no success. The form is initialised with a 32 bit depth. Any ideas?
I'm using Squeak 2.8 (I think… it's the MIT Scratch image).
This should work:
Display fill: (0@0 corner: 200@200) rule: Form blend fillColor: (Color red alpha: 0.5)
(assuming your Display is 32 bits). See BitBlt class>>alphaBlendDemo for other display depths.
Additionally, there is rule 34 for blending with pre-multiplied alpha, if you want to get serious.
- Bert -
squeak-dev@lists.squeakfoundation.org