Exemple #1
0
        private void CreateEffect()
        {
            effect = new Microsoft.Graphics.Canvas.Effects.GrayscaleEffect()
            {
                Name   = EffectName,
                Source = new CompositionEffectSourceParameter(EffectSource)
            };

            effectFactory = compositor.CreateEffectFactory(effect);
        }
Exemple #2
0
        public void Dispose()
        {
            imageFactory = null;
            imageSource  = null;


            if (effect != null)
            {
                effect.Dispose();
                effect = null;
            }

            if (surfaceBrush != null)
            {
                surfaceBrush.Surface = null;
                surfaceBrush.Dispose();
                surfaceBrush = null;
            }

            //if (visual != null)
            //{
            //    if(spriteVisual!=null) visual.Children.Remove(spriteVisual);
            //    visual.Dispose();
            //    visual = null;
            //}

            if (effectBrush != null)
            {
                effectBrush.SetSourceParameter(EffectSource, null);
                effectBrush.Dispose();
                effectBrush = null;
            }

            if (spriteVisual != null)
            {
                spriteVisual.Brush = null;
                spriteVisual.Dispose();
                spriteVisual = null;
            }
        }
Exemple #3
0
        public void Dispose()
        {
            imageFactory = null;
            imageSource = null;


            if (effect != null)
            {
                effect.Dispose();
                effect = null;
            }

            if (surfaceBrush != null)
            {
                surfaceBrush.Surface = null;
                surfaceBrush.Dispose();
                surfaceBrush = null;
            }

            //if (visual != null)
            //{
            //    if(spriteVisual!=null) visual.Children.Remove(spriteVisual);
            //    visual.Dispose();
            //    visual = null;
            //}
            
            if (effectBrush != null)
            {
                effectBrush.SetSourceParameter(EffectSource, null);
                effectBrush.Dispose();
                effectBrush = null;
            }

            if (spriteVisual != null) {
                spriteVisual.Brush = null;
                spriteVisual.Dispose();
                spriteVisual = null;
            }
            
        }
Exemple #4
0
        private void CreateEffect()
        {
            effect = new Microsoft.Graphics.Canvas.Effects.GrayscaleEffect()
            {
                Name = EffectName,
                Source = new CompositionEffectSourceParameter(EffectSource)
            };

            effectFactory = compositor.CreateEffectFactory(effect);
        }