public override System.Windows.Media.Effects.Effect FliterEffect(double amount, double saturation) { byte bt = Convert.ToByte(235 + amount * 2); MonochromeEffect monochrome1 = new MonochromeEffect(); monochrome1.FilterColor = System.Windows.Media.Color.FromRgb(bt, bt, bt); return(monochrome1); }
/// <summary> /// thread safe /// </summary> public void Deactivate() { Dispatcher.BeginInvoke(new Action(() => { if (active) { active = false; MonochromeEffect eff = new MonochromeEffect(); eff.FilterColor = Color.FromArgb(0x00, 0x40, 0x40, 0x40); /*EmbossedEffect eff = new EmbossedEffect(); * eff.Amount = 10; * eff.Width = 0.001;*/ ButtonImage.Effect = eff; } })); }
private void UpdateEffect() { if (Value) { AssociatedObject.ClearValue(UIElement.EffectProperty); return; } if (_monochromeEffect == null) { _monochromeEffect = new MonochromeEffect { FilterColor = Colors.White } } ; AssociatedObject.Effect = _monochromeEffect; }
public void toggleMonochrome(bool _yesNo) { if (_yesNo == true) { if (_monoFX == null) { _monoFX = new MonochromeEffect(); _monoFX.FilterColor = Color.FromArgb(0, 255, 255, 255); _monoFX.Contrast = Properties.Settings.Default.monochromeEffectContrastMultiplier; } if (this._kColorImage != null) { this._kColorImage.Effect = _monoFX; } } else { if (this._kColorImage != null) { this._kColorImage.Effect = null; } } }
public void destroyInternals() { if (_sensor != null) { _sensor.AllFramesReady -= kinectAllFramesReady; } if (_greenScreenProcessor != null) { _greenScreenProcessor.frameReadyForDisplay -= greenScreenFrameReady; _greenScreenProcessor.destroyInternals(); _greenScreenProcessor = null; } if (_bgImage != null) { if (kiddieHolder.Children.Contains(_bgImage)) { kiddieHolder.Children.Remove(_bgImage); } _bgImage.Source = null; } if (_fgImage != null) { if (kiddieHolder.Children.Contains(_fgImage)) { kiddieHolder.Children.Remove(_fgImage); } _fgImage.Source = null; } if (_kColorImage != null) { if (kiddieHolder.Children.Contains(_kColorImage)) { kiddieHolder.Children.Remove(_kColorImage); } _kColorImage.Effect = null; _kColorImage.Source = null; _kColorImage = null; this.colorBitmap = null; _monoFX = null; } if (_noKinect != null) { if (kiddieHolder.Children.Contains(_noKinect)) { kiddieHolder.Children.Remove(_noKinect); } _noKinect = null; } if (_photoSubmitter != null) { _photoSubmitter.ImageSubmissionComplete -= handlePhotoSubmittedToCMS; _photoSubmitter.destroyInternals(); _photoSubmitter = null; } }
override public void Invoke() { MonochromeEffect.StartDoingTheMonochrome(Duration); }
public Monochrome(SpriteBatch spriteBatch, Effect monochromeEffect) : base(spriteBatch) { this.monochromeEffect = new MonochromeEffect(monochromeEffect); }
// Start is called before the first frame update void Start() { instance = this; }
protected override void LoadContent() { monochromeEffect = EffectManager.Load<MonochromeEffect>(); base.LoadContent(); }