You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
auto hostVisual = winrt::Microsoft::UI::Xaml::Hosting::ElementCompositionPreview::GetElementVisual(ShadowHost());
auto compositor = hostVisual.Compositor();
auto dropShadow = compositor.CreateDropShadow();
dropShadow.Color(winrt::Windows::UI::ColorHelper::FromArgb(255, 0, 0, 0));
dropShadow.BlurRadius(25);
dropShadow.Opacity(0.5);
auto pathMask = MyOtherPath().GetAlphaMask();
dropShadow.Mask(pathMask);
auto spriteVisual = compositor.CreateSpriteVisual();
spriteVisual.Size({ 400,400 });
spriteVisual.Shadow(dropShadow);
winrt::Microsoft::UI::Xaml::Hosting::ElementCompositionPreview::SetElementChildVisual(ShadowHost(), spriteVisual);
With auto pathMask = MyOtherPath().GetAlphaMask();, no shadow is created. I know the visual is empty because I also tried setting the GetAlphaMask output directly to the host visual which worked for the other shapes/text but not the Path.
Expected behavior
I'd expect the code above produce the same results as with the Rectangle shape directly. Then, I'd expect to also be able to generate masks/shadows for arbitrary geometry within the path (e.g. closed, filled path figures).
Screenshots
auto pathMask = MyRectangle().GetAlphaMask();
auto pathMask = MyText().GetAlphaMask();
NuGet package version
WinUI 3 - Windows App SDK 1.5.6: 1.5.240802000
Windows version
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
When calling Shape.GetAlphaMask on a Microsoft.UI.Xaml.Shapes.Path, no visual is returned.
Steps to reproduce the bug
XAML
CPP
With
auto pathMask = MyOtherPath().GetAlphaMask();
, no shadow is created. I know the visual is empty because I also tried setting the GetAlphaMask output directly to the host visual which worked for the other shapes/text but not the Path.Expected behavior
I'd expect the code above produce the same results as with the Rectangle shape directly. Then, I'd expect to also be able to generate masks/shadows for arbitrary geometry within the path (e.g. closed, filled path figures).
Screenshots
auto pathMask = MyRectangle().GetAlphaMask();
auto pathMask = MyText().GetAlphaMask();
NuGet package version
WinUI 3 - Windows App SDK 1.5.6: 1.5.240802000
Windows version
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: