diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-06-27 17:46:16 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-06-27 17:46:16 +0300 |
| commit | d84f725f000652adf6dc563bc704dba43dd27518 (patch) | |
| tree | d6a2957d01a77686aff08d365d9718e61f2af08e /Software/Visual_Studio/Tango.SharedUI/Effects | |
| parent | f99f56c619bed96ab7b75be8477dec6e504bad7e (diff) | |
| download | Tango-d84f725f000652adf6dc563bc704dba43dd27518.tar.gz Tango-d84f725f000652adf6dc563bc704dba43dd27518.zip | |
Implemented loading twine logo..
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI/Effects')
| -rw-r--r-- | Software/Visual_Studio/Tango.SharedUI/Effects/DisplaySettingEffect.cs | 98 | ||||
| -rw-r--r-- | Software/Visual_Studio/Tango.SharedUI/Effects/displaysettingeffect.ps | bin | 0 -> 524 bytes |
2 files changed, 98 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.SharedUI/Effects/DisplaySettingEffect.cs b/Software/Visual_Studio/Tango.SharedUI/Effects/DisplaySettingEffect.cs new file mode 100644 index 000000000..386ee05fb --- /dev/null +++ b/Software/Visual_Studio/Tango.SharedUI/Effects/DisplaySettingEffect.cs @@ -0,0 +1,98 @@ + +namespace Tango.SharedUI.Effects +{ + using System; + using System.ComponentModel; + using System.Text; + using System.Windows; + using System.Windows.Media; + using System.Windows.Media.Effects; + + public class DisplaySettingEffect : ShaderEffect + { + public static readonly DependencyProperty BrightnessLevelProperty = DependencyProperty.Register("BrightnessLevel", typeof(double), typeof(DisplaySettingEffect), new UIPropertyMetadata(1.0, ShaderEffect.PixelShaderConstantCallback(1))); + public static readonly DependencyProperty ContrastLevelProperty = DependencyProperty.Register("ContrastLevel", typeof(double), typeof(DisplaySettingEffect), new UIPropertyMetadata(1.0, ShaderEffect.PixelShaderConstantCallback(0))); + public static readonly DependencyProperty Input1Property = ShaderEffect.RegisterPixelShaderSamplerProperty("Input1", typeof(DisplaySettingEffect), 0); + public static readonly DependencyProperty SaturationLevelProperty = DependencyProperty.Register("SaturationLevel", typeof(double), typeof(DisplaySettingEffect), new UIPropertyMetadata(1.0, ShaderEffect.PixelShaderConstantCallback(2))); + + /// <summary> + /// Initializes a new instance of the <see cref="DisplaySettingEffect"/> class. + /// </summary> + public DisplaySettingEffect() + : base() + { + PixelShader pixelShader = new PixelShader(); + pixelShader.UriSource = new Uri("pack://application:,,,/Tango.SharedUI;component/Effects/DisplaySettingEffect.ps", UriKind.RelativeOrAbsolute); + this.PixelShader = pixelShader; + + this.UpdateShaderValue(Input1Property); + this.UpdateShaderValue(ContrastLevelProperty); + this.UpdateShaderValue(Input1Property); + this.UpdateShaderValue(BrightnessLevelProperty); + this.UpdateShaderValue(Input1Property); + this.UpdateShaderValue(SaturationLevelProperty); + } + + /// <summary> + /// Gets or sets the brightness level. + /// </summary> + public double BrightnessLevel + { + get + { + return (double)base.GetValue(BrightnessLevelProperty); + } + set + { + base.SetValue(BrightnessLevelProperty, value); + } + } + + /// <summary> + /// Gets or sets the contrast level. + /// </summary> + public double ContrastLevel + { + get + { + return (double)base.GetValue(ContrastLevelProperty); + } + set + { + base.SetValue(ContrastLevelProperty, value); + } + } + + /// <summary> + /// Gets or sets the saturation level. + /// </summary> + public double SaturationLevel + { + get + { + return (double)base.GetValue(SaturationLevelProperty); + } + set + { + base.SetValue(SaturationLevelProperty, value); + } + } + + /// <summary> + /// Gets or sets the input. + /// </summary> + [Browsable(false)] + public Brush Input1 + { + get + { + return (Brush)base.GetValue(Input1Property); + } + set + { + base.SetValue(Input1Property, value); + } + } + } +} + diff --git a/Software/Visual_Studio/Tango.SharedUI/Effects/displaysettingeffect.ps b/Software/Visual_Studio/Tango.SharedUI/Effects/displaysettingeffect.ps Binary files differnew file mode 100644 index 000000000..1ec9ee9f5 --- /dev/null +++ b/Software/Visual_Studio/Tango.SharedUI/Effects/displaysettingeffect.ps |
