[squeak-dev] Re: [Vm-dev] Balloon engine and bitmap fills: any clues why it ignores an alpha channel of bitmap?

Andreas Raab andreas.raab at gmx.de
Thu Apr 21 17:17:57 UTC 2011


Hi -

[Apologies for being off-topic on vm-dev; I've set the reply-to to 
squeak-dev]

On 4/21/2011 15:44, Igor Stasenko wrote:
>
> I tried various paint rules
> 24, 34
>
> nothing. A balloon engine seems like completely ignores an alpha channel,
> so i could use it for filling shapes using bitmaps as long as these
> bitmaps fully opaque.
>
> I thought i could use a generic way to render bitmaps, instead of
> using awkward warpBlt...
> but it seems like something in plugin discards/ignores an alpha
> channel of source bitmap.
> I would be happy if this is not true.

It isn't true. Here is an example for transparent bitmap rendering with 
the Balloon engine:

     "First we create a bitmap with a transparent pattern"
     f := Form extent: 100 at 100 depth: 32.
     f getCanvas asBalloonCanvas
         fillRectangle: f boundingBox
         fillStyle:
             ((GradientFillStyle colors: {Color transparent. Color white})
                 origin: 0 at 0; direction: 0 at 100).

     "Now we're displaying it"
     (Display getCanvas asBalloonCanvas)
         transformBy: ((MatrixTransform2x3 withAngle: 45));
         fillRectangle: (400 at 0 extent: 400 at 400)
         fillStyle: (BitmapFillStyle fromForm: f)

I'm not sure what you've been playing with but generally speaking you'll 
be better off with BalloonCanvas instead of trying to manipulate the 
Balloon engine directly.

Cheers,
   - Andreas




More information about the Squeak-dev mailing list