-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to apply DropShadow to an Ellipse filled with RadialGradientBrush #3098
Comments
Thanks for the report @timunie, we definitely see this behavior. Probably has to do with how masks are being generated. However, the brush is being added to WinUI now: microsoft/microsoft-ui-xaml#266 So we should validate the initial implementation of their brush and fix it there instead, as once that ships, we'll be deprecating the version in the toolkit. FYI @jesbis @SavoySchuler |
Yeah masks look like the culprit - I think this may be a generic issue with calling GetAlphaMask() (like DropShadowPanel does when setting IsMasked=true) on any element filled with any XamlCompositionBrush (which is what both implementations of RadialGradientBrush use). Even using a solid color CompositionColorBrush doesn't work. I opened a WinUI bug here for the generic issue: Related: @michael-hawker are these docs out of date? I don't see the IsMasked property: |
Thank you for taking your time and inspection. I didn't know that this was available in WinUi already. Should I close this issue? Have a nice weekend |
@timunie the first preview was just added, so I think we should leave this open until we've confirmed hand-off with WinUI if it's a general composition brush issue. |
@jesbis yeah, I think the doc is out of date, we had issues trying to get them updated after the last release, I need to get back to investigate what happened. Thanks for investigating and opening the WinUI issue. |
Shape.GetAlphaMask() is created by drawing the shape into a static bitmap. The actual XamlCompositionBrushBase.CompositionBrush can't be used for this, so it gets drawn with the FallbackColor. The default FallbackColor for XamlCompositionBrushBase is Transparent, so if the brush or the app doesn't set a different FallbackColor, the drawn shape in the AlphaMask will be completely transparent. Setting, for example, FallbackColor = Colors.Green in the sample app's construction of the RadialGradientBrush in Ball.cs gets the shadow to render. (There is a separate issue somewhere where the shadows of balls which get added by clicking all end up in the upper-left corner. But there are shadows! 😄) |
Hi @codendone Happy Sunday |
Going to close this as there's a general issue open on the platform and a workaround by setting the |
Describe the bug
I am trying to apply a
DropShadow
to anEllispe
filled with aRadialGradientBrush
I am not able to get this to work. TheDropShadowPanel
works as expected if I change theBrush
to aSolidColorBrush
Steps to Reproduce
where
Fill
is aRadialGragientBrush
generated in code behindWith RadialGadientBrush
With SolidColorBrush
Expected behavior
image 2 with the
RadialGradientBrush
appliedScreenshots
see above
Environment
Additional context
Here is a sample App if it helps. Note: I am not a programmer by profession, so maybe this code is not up to your standard 😄 https://github.com/timunie/Bubblez
The text was updated successfully, but these errors were encountered: