Hi all,
try out this:
m := Morph new color: (Color red alpha: 0.5).
m openInHand.
m imageForm openAsMorph.
And for completeness' sake, "m imageForm asMorph imageForm openAsMorph" appears just a bit darker again.
I traced the issue down to two methods: For the regular Morph, FormCanvas >> #setFillColor:, and for the ImageMorph, Canvas >> #translucentImage:at:sourceRect:. In both methods, at the end, the rule Form blend is used to draw the image. If I change it to Form over, the colors are the same and the issue seems to be fixed. But unfortunately, I could not find any documentation about the different Form rules such as #blend, #over, #paint etc. Can you give me some pointers?
Also, I noted the comment in #translucentImage:at:sourceRect: which states:
"Draw a translucent image using the best available way of representing translucency.
Note: This will be fixed in the future."
Which workaround is this comment referring to?
Looking forward to your help! :-)
Best, Christoph
Carpe Squeak!
|
> But unfortunately, I could not find any documentation about the
> different Form rules such as #blend, #over, #paint etc. Can you give me > some pointers? Related thread: http://forum.world.st/ImageForm-color-with-alpha-td5090574.html Stef |
Thanks for the pointer, Stef. I think we really need some kind of documentation of the form rules to decide whether we can apply Marcel's solution. Did anyone ever read something about it?
Best, Christoph Von: Squeak-dev <[hidden email]> im Auftrag von Stéphane Rollandin <[hidden email]>
Gesendet: Samstag, 19. September 2020 22:34:21 An: [hidden email] Betreff: Re: [squeak-dev] ColorForm with transparency not working properly > But unfortunately, I could not find any documentation about the
> different Form rules such as #blend, #over, #paint etc. Can you give me > some pointers? Related thread: http://forum.world.st/ImageForm-color-with-alpha-td5090574.html Stef
Carpe Squeak!
|
It is this code that apply the blendAlphaScaled. BalloonEngine>>bitBlt: aBitBlt | destWidth |bitBlt := aBitBlt. bitBlt isNil ifTrue:[^self]. destWidth := bitBlt destForm width. destWidth > span size ifTrue:[span := Bitmap new: destWidth]. self class primitiveSetBitBltPlugin: bitBlt getPluginName. self clipRect: bitBlt clipRect. bitBlt sourceForm: (Form extent: span size @ 1 depth: 32 bits: span); sourceRect: (0@0 extent: 1@span size); colorMap: (Color colorMapIfNeededFrom: 32 to: bitBlt destForm depth); combinationRule: (bitBlt destForm depth >= 8 ifTrue:[34"
blendAlphaScaled
"] ifFalse:[Form paint]). Best, Karl On Mon, Sep 21, 2020 at 9:31 PM Thiede, Christoph <[hidden email]> wrote:
|
See also mail from
Juan Vuletich in vm-dev list:"Proposal for new BitBlt rules (#505)" which has fixes for alpha blending Best, Karl On Mon, Sep 21, 2020 at 9:44 PM karl ramberg <[hidden email]> wrote:
|
In reply to this post by Christoph Thiede
On Mon, Sep 21, 2020 at 9:31 PM Thiede, Christoph <[hidden email]> wrote:
|
Thanks, Karl.
Still, I do not see what the combination rules are good for. For example, my image does not implement #alphaBlend:with:. Here is another request for some documentation of the combination rules: https://github.com/MrModder/Autocompletion/issues/36 Best, Christoph -- Sent from: http://forum.world.st/Squeak-Dev-f45488.html
Carpe Squeak!
|
Free forum by Nabble | Edit this page |