asusralis
Topic Author
Posts: 144
Joined: 30 Jul 2018, 05:03

Is there a nine slice mask brush shader available?

24 Apr 2023, 11:29

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?
 
User avatar
jsantos
Site Admin
Posts: 3938
Joined: 20 Jan 2012, 17:18
Contact:

Re: Is there a nine slice mask brush shader available?

26 Apr 2023, 14:12

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?
 
asusralis
Topic Author
Posts: 144
Joined: 30 Jul 2018, 05:03

Re: Is there a nine slice mask brush shader available?

06 May 2023, 21:38

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?
 
User avatar
jsantos
Site Admin
Posts: 3938
Joined: 20 Jan 2012, 17:18
Contact:

Re: Is there a nine slice mask brush shader available?

08 May 2023, 11:41

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>

Who is online

Users browsing this forum: Google [Bot] and 2 guests