WPF Shader 简单使用

点击查看原图



<Grid>
    <ItemsControl x:Name="ShaderList">
        <ItemsControl.ItemsPanel>
            <ItemsPanelTemplate>
                <UniformGrid Columns="8" Rows="8" />
            </ItemsPanelTemplate>
        </ItemsControl.ItemsPanel>
        <!--<ItemsControl.ItemTemplate>
                <DataTemplate>
                    <StackPanel>
                        <Image Source="{Binding Nail}" Width="25" Height="25" />
                        <TextBlock Text="{Binding Description}" />
                    </StackPanel>
                </DataTemplate>
            </ItemsControl.ItemTemplate>-->
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                                  
            </Image>
            <TextBlock Text="原图" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:AddShaderEffect />
                </Image.Effect>
            </Image>
            <TextBlock Text="AddShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:AlphaShaderEffect Alpha="0.4" />
                </Image.Effect>
            </Image>
            <TextBlock Text="AlphaShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:BandedSwirlShaderEffect SpiralStrength="0.5" />
                </Image.Effect>
            </Image>
            <TextBlock Text="BandedSwirlShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:BloomShaderEffect BloomIntensity="0.5" BloomSaturation="2" />
                </Image.Effect>
            </Image>
            <TextBlock Text="BloomShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:BrightExtractShaderEffect Threshold="0.5" />
                </Image.Effect>
            </Image>
            <TextBlock Text="BrightExtractShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:ColorKeyAlphaShaderEffect />
                </Image.Effect>
            </Image>
            <TextBlock Text="ColorKeyAlphaShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:ColorToneShaderEffect LightColor="Red" DarkColor="AliceBlue" Desaturation="0.2" Toned="0.3" />
                </Image.Effect>
            </Image>
            <TextBlock Text="ColorToneShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:ContrastAdjustShaderEffect Brightness="Red" Contrast="0.9" />
                </Image.Effect>
            </Image>
            <TextBlock Text="ContrastAdjustShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:DarkenShaderEffect Alpha="0.3" />
                </Image.Effect>
            </Image>
            <TextBlock Text="DarkenShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:DifferenceShaderEffect Alpha="0.3" Multiplier="0.3" />
                </Image.Effect>
            </Image>
            <TextBlock Text="DifferenceShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:DirectionalBlurShaderEffect Angle="25" BlurAmount="0.1" />
                </Image.Effect>
            </Image>
            <TextBlock Text="DirectionalBlurShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:EmbossedShaderEffect Width="0.2" Amount="0.6" />
                </Image.Effect>
            </Image>
            <TextBlock Text="EmbossedShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:GrowablePoissonDiskShaderEffect DiscRadius="5" ScreenSize="20, 20" />
                </Image.Effect>
            </Image>
            <TextBlock Text="GrowablePoissonDiskShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:IdentityShaderEffect  />
                </Image.Effect>
            </Image>
            <TextBlock Text="IdentityShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:InvertColorShaderEffect  />
                </Image.Effect>
            </Image>
            <TextBlock Text="InvertColorShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:LightenShaderEffect Alpha="0.8"  />
                </Image.Effect>
            </Image>
            <TextBlock Text="LightenShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:LightStreakShaderEffect Scale="0.4" BrightThreshold="0.9" />
                </Image.Effect>
            </Image>
            <TextBlock Text="LightStreakShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:MagnifyShaderEffect Radii="5, 5" Amount="2" />
                </Image.Effect>
            </Image>
            <TextBlock Text="MagnifyShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:MonochromeShaderEffect FilterColor="Red" />
                </Image.Effect>
            </Image>
            <TextBlock Text="MonochromeShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:MultiplyShaderEffect Alpha="0.9" />
                </Image.Effect>
            </Image>
            <TextBlock Text="MultiplyShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:NegationDifferenceShaderEffect Alpha="0.9" />
                </Image.Effect>
            </Image>
            <TextBlock Text="NegationDifferenceShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:PinchShaderEffect Radius="15" Amount="2" />
                </Image.Effect>
            </Image>
            <TextBlock Text="PinchShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:PixelateShaderEffect />
                </Image.Effect>
            </Image>
            <TextBlock Text="PixelateShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:RippleShaderEffect />
                </Image.Effect>
            </Image>
            <TextBlock Text="RippleShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:SharpenShaderEffect />
                </Image.Effect>
            </Image>
            <TextBlock Text="SharpenShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:SmoothMagnifyShaderEffect InnerRadius="0.3" />
                </Image.Effect>
            </Image>
            <TextBlock Text="SmoothMagnifyShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:SobelShaderEffect />
                </Image.Effect>
            </Image>
            <TextBlock Text="SobelShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:SwirlShaderEffect />
                </Image.Effect>
            </Image>
            <TextBlock Text="SwirlShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:ToonShaderEffect />
                </Image.Effect>
            </Image>
            <TextBlock Text="ToonShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:ZoomBlurShaderEffect />
                </Image.Effect>
            </Image>
            <TextBlock Text="ZoomBlurShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:WaveTransitionShaderEffect Progress="0.6" />
                </Image.Effect>
            </Image>
            <TextBlock Text="WaveTransitionShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:WaterTransitionShaderEffect Progress="0.5" RandomSeed="3" />
                </Image.Effect>
            </Image>
            <TextBlock Text="WaterTransitionShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:SwirlGridTransitionShaderEffect Progress="4" TwistAmount="5,5 " />
                </Image.Effect>
            </Image>
            <TextBlock Text="SwirlGridTransitionShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:SmoothSwirlGridTransitionShaderEffect Progress="4" TwistAmount="5,5 " />
                </Image.Effect>
            </Image>
            <TextBlock Text="SmoothSwirlGridTransitionShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:SlideInTransitionShaderEffect Progress="0.5" SlideAmount="5,5 " />
                </Image.Effect>
            </Image>
            <TextBlock Text="SlideInTransitionShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:ShrinkTransitionShaderEffect Progress="0.5" />
                </Image.Effect>
            </Image>
            <TextBlock Text="ShrinkTransitionShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:SaturateTransitionShaderEffect Progress="0.6" />
                </Image.Effect>
            </Image>
            <TextBlock Text="SaturateTransitionShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:RippleTransitionShaderEffect Progress="6" />
                </Image.Effect>
            </Image>
            <TextBlock Text="RippleTransitionShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:RadialBlurTransitionShaderEffect Progress="6" />
                </Image.Effect>
            </Image>
            <TextBlock Text="RadialBlurTransitionShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:PixelateTransitionShaderEffect Progress="0.4" />
                </Image.Effect>
            </Image>
            <TextBlock Text="PixelateTransitionShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:PixelateOutTransitionShaderEffect Progress="4" />
                </Image.Effect>
            </Image>
            <TextBlock Text="PixelateOutTransitionShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:PixelateInTransitionShaderEffect />
                </Image.Effect>
            </Image>
            <TextBlock Text="PixelateInTransitionShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:MostBrightTransitionShaderEffect Progress="10" />
                </Image.Effect>
            </Image>
            <TextBlock Text="MostBrightTransitionShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:LeastBrightTransitionShaderEffect Progress="10" />
                </Image.Effect>
            </Image>
            <TextBlock Text="LeastBrightTransitionShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:FadeTransitionShaderEffect Progress="15" />
                </Image.Effect>
            </Image>
            <TextBlock Text="FadeTransitionShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:CircleStretchTransitionShaderEffect Progress="0.6" />
                </Image.Effect>
            </Image>
            <TextBlock Text="CircleStretchTransitionShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:CircleRevealTransitionShaderEffect Progress="6" FuzzyAmount="3" />
                </Image.Effect>
            </Image>
            <TextBlock Text="CircleRevealTransitionShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:BlindsTransitionShaderEffect Progress="0.6" />
                </Image.Effect>
            </Image>
            <TextBlock Text="BlindsTransitionShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:BandedTransitionShaderEffect Progress="0.6" />
                </Image.Effect>
            </Image>
            <TextBlock Text="BandedTransitionShaderEffect" />
        </StackPanel>
        <StackPanel Width="100">
            <Image Source="/Images/CC.jpg">
                <Image.Effect>
                    <effects:BandedSwirlTransitionShaderEffect Progress="0.6" TwistAmount="3" Frequency="5" />
                </Image.Effect>
            </Image>
            <TextBlock Text="BandedSwirlTransitionShaderEffect" />
        </StackPanel>
    </ItemsControl>
</Grid>


知识共享许可协议
《WPF Shader 简单使用》常伟华 创作。
采用 知识共享 署名-相同方式共享 3.0 中国大陆 许可协议进行许可。
相邻依据:发表时间
  • 多说评论
  • 签名
  • 新浪微博
  • 默认评论
  • Tab Header 5

0 条评论 / 点击此处发表评论

Tab Content 5

开发技术


开发平台和工具

sitemap     157.70ms