Page 1 of 1
Is there a nine slice mask brush shader available?
Posted: 24 Apr 2023, 11:29
by asusralis
I am creating a progress bar that uses a nineslice background which also requires a nineslice mask. I see one referenced
here but I can't seem to find this shader anywhere. Where can I find it?
Re: Is there a nine slice mask brush shader available?
Posted: 26 Apr 2023, 14:12
by jsantos
I have attached the shader to the ticket (
#2330). Not sure how useful this is going to be for you.
Could you please describe more what you want to achieve?
Re: Is there a nine slice mask brush shader available?
Posted: 06 May 2023, 21:38
by asusralis
I want to create a mask using a nineslice image so children will be masked according to the nineslice. What you posted should be able to be used for this, yes?
Re: Is there a nine slice mask brush shader available?
Posted: 08 May 2023, 11:41
by jsantos
Yes, something like this (example taken from the ticket)
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:noesis="clr-namespace:NoesisGUIExtensions;assembly=Noesis.GUI.Extensions">
<Image x:Name="img" Source="Images/map.png" Margin="100">
<Image.OpacityMask>
<ImageBrush ImageSource="Images/border-mask.png">
<ImageBrush.Shader>
<noesis:NineSliceMaskBrushShader Slices="20,30,40,54" Width="{Binding ActualWidth, ElementName=img}" Height="{Binding ActualHeight, ElementName=img}"/>
</ImageBrush.Shader>
</ImageBrush>
</Image.OpacityMask>
</Image>
</Grid>