コード例 #1
0
        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);
        }
コード例 #2
0
        /// <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;
                }
            }));
        }
コード例 #3
0
        private void UpdateEffect()
        {
            if (Value)
            {
                AssociatedObject.ClearValue(UIElement.EffectProperty);
                return;
            }

            if (_monochromeEffect == null)
            {
                _monochromeEffect = new MonochromeEffect {
                    FilterColor = Colors.White
                }
            }
            ;

            AssociatedObject.Effect = _monochromeEffect;
        }
コード例 #4
0
 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;
         }
     }
 }
コード例 #5
0
        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;
            }
        }
コード例 #6
0
 override public void Invoke()
 {
     MonochromeEffect.StartDoingTheMonochrome(Duration);
 }
コード例 #7
0
 public Monochrome(SpriteBatch spriteBatch, Effect monochromeEffect)
     : base(spriteBatch)
 {
     this.monochromeEffect = new MonochromeEffect(monochromeEffect);
 }
コード例 #8
0
 // Start is called before the first frame update
 void Start()
 {
     instance = this;
 }
コード例 #9
0
ファイル: Monochrome.cs プロジェクト: willcraftia/WindowsGame
        protected override void LoadContent()
        {
            monochromeEffect = EffectManager.Load<MonochromeEffect>();

            base.LoadContent();
        }
コード例 #10
0
ファイル: Monochrome.cs プロジェクト: willcraftia/TestBlocks
 public Monochrome(SpriteBatch spriteBatch, Effect monochromeEffect)
     : base(spriteBatch)
 {
     this.monochromeEffect = new MonochromeEffect(monochromeEffect);
 }