More on invisible icons bug in 32-bit depth
Andreas Raab
andreas.raab at gmx.de
Thu Feb 27 20:43:04 UTC 2003
Ned,
I think you're seeing a problem which I've seen in Croquet all the time.
There are some rather obscure circumstances in which alpha extension from 16
to 32bpp is not correctly handled by BitBlt.
Here's a good one - go to 32bpp and evaluate:
Display getCanvas
translucentImage: PaintBoxMorph new imageForm
at: 0 at 0.
That should explain things. For this problem I've actually introduced a new
BitBlt rule a while ago - here's the example that'll solve the above
problem:
image := PaintBoxMorph new imageForm.
(BitBlt toForm: image)
combinationRule: 40; "fixAlpha:with:"
halftoneForm: (Bitmap with: 16rFF000000);
copyBits.
Display getCanvas translucentImage: image at: 0 at 0.
Note: I am aware that this will not help you (since Croquet's use of it is
very limited and can be controlled much easier) but it will help you
understanding the problem.
Cheers,
- Andreas
> -----Original Message-----
> From: squeak-dev-bounces at lists.squeakfoundation.org
> [mailto:squeak-dev-bounces at lists.squeakfoundation.org] On
> Behalf Of Ned Konz
> Sent: Thursday, February 27, 2003 9:28 PM
> To: squeak-dev at lists.squeakfoundation.org
> Subject: More on invisible icons bug in 32-bit depth
>
>
> I've tracked it down into the drawing of the SketchMorph
> that's in the
> IconicButtons.
>
> The stack at this point looks like this:
>
> FormCanvas(Canvas)>>translucentImage:at:sourceRect:
> FormCanvas(Canvas)>>translucentImage:at:
> SketchMorph>>drawOn:
> FormCanvas(Canvas)>>draw:
> FormCanvas(Canvas)>>drawMorph:
> [] in SketchMorph(Morph)>>fullDrawOn:
> FormCanvas>>roundCornersOf:in:during:
> FormCanvas(Canvas)>>roundCornersOf:during:
> SketchMorph(Morph)>>fullDrawOn:
> FormCanvas(Canvas)>>fullDraw:
> FormCanvas(Canvas)>>fullDrawMorph:
> [] in SketchMorph(Morph)>>imageForm:forRectangle:
> FormCanvas>>translateBy:during:
> SketchMorph(Morph)>>imageForm:forRectangle:
> SketchMorph(Morph)>>imageFormForRectangle:
> SketchMorph(Morph)>>imageForm
>
> The problem is that after
> FormCanvas(Canvas)>>translucentImage:at:sourceRect: the form in the
> canvas has a transparent icon.
>
> If I go:
>
> aForm copy openAsMorph
>
> that is, take the form that's being drawn to the canvas and
> open it, I
> can see it fine.
>
> If I then do the same with the canvas' form at the end of the method,
> it's transparent.
>
> The code in Canvas>>translucentImage:at:sourceRect: is doing this:
>
> self image: aForm
> at: aPoint
> sourceRect: sourceRect
> rule: Form blend
>
> Why would this result in part of the image (the part that holds the
> thumbnail of the tool) being transparent?
>
> Is it maybe that we can't render smoothed forms as translucent in 32
> bits? The thumbnail has smoothing turned on:
>
> self form: (f magnify: f boundingBox by: (scaleX @
> scaleY) smoothing:
> 2).
>
> --
> Ned Konz
> http://bike-nomad.com
> GPG key ID: BEEA7EFE
>
>
More information about the Squeak-dev
mailing list
|