Ejemplo n.º 1
0
        public void OnDeserialization(object sender)
        {
            if (this.properties.opacity != -1)
            {
                this.PushSuppressPropertyChanged();
                base.Opacity            = (byte)this.properties.opacity;
                this.properties.opacity = -1;
                this.PopSuppressPropertyChanged();
            }

            this.compiledBlendOp = null;
        }
Ejemplo n.º 2
0
        private void CompileBlendOp()
        {
            bool isDefaultOp = (properties.blendOp.GetType() == UserBlendOps.GetDefaultBlendOp());

            if (this.Opacity == 255)
            {
                this.compiledBlendOp = properties.blendOp;
            }
            else
            {
                this.compiledBlendOp = properties.blendOp.CreateWithOpacity(this.Opacity);
            }
        }
Ejemplo n.º 3
0
        private void CompileBlendOp()
        {
            bool isDefaultOp = (properties.blendOp.GetType() == UserBlendOps.GetDefaultBlendOp());

            if (this.Opacity == 255)
            {
                this.compiledBlendOp = properties.blendOp;
            }
            else
            {
                this.compiledBlendOp = properties.blendOp.CreateWithOpacity(this.Opacity);
            }
        }
Ejemplo n.º 4
0
        public void SetBlendOp(UserBlendOp blendOp)
        {
            if (disposed)
            {
                throw new ObjectDisposedException("BitmapLayer");
            }

            if (blendOp.GetType() != properties.blendOp.GetType())
            {
                OnPropertyChanging(BitmapLayerProperties.BlendOpName);
                properties.blendOp = blendOp;
                compiledBlendOp    = null;
                Invalidate();
                OnPropertyChanged(BitmapLayerProperties.BlendOpName);
            }
        }
Ejemplo n.º 5
0
        public override void LoadProperties(object oldState, bool suppressEvents)
        {
            if (disposed)
            {
                throw new ObjectDisposedException("BitmapLayer");
            }

            List list = (List)oldState;

            // Get the base class' state, and our state
            LayerProperties       baseState = (LayerProperties)list.Tail.Head;
            BitmapLayerProperties blp       = (BitmapLayerProperties)(((List)oldState).Head);

            // Opacity is only couriered for compatibility with PDN v2.0 and v1.1
            // files. It should not be present in v2.1+ files (well, it'll be
            // part of the base class' serialization)
            if (blp.opacity != -1)
            {
                baseState.opacity = (byte)blp.opacity;
                blp.opacity       = -1;
            }

            // Have the base class load its properties
            base.LoadProperties(baseState, suppressEvents);

            // Now load our properties, and announce them to the world
            bool raiseBlendOp = false;

            if (blp.blendOp.GetType() != properties.blendOp.GetType())
            {
                if (!suppressEvents)
                {
                    raiseBlendOp = true;
                    OnPropertyChanging(BitmapLayerProperties.BlendOpName);
                }
            }

            this.properties      = (BitmapLayerProperties)blp.Clone();
            this.compiledBlendOp = null;

            Invalidate();

            if (raiseBlendOp)
            {
                OnPropertyChanged(BitmapLayerProperties.BlendOpName);
            }
        }
Ejemplo n.º 6
0
        public void OnDeserialization(object sender)
        {
            if (this.properties.opacity != -1)
            {
                this.PushSuppressPropertyChanged();
                base.Opacity = (byte)this.properties.opacity;
                this.properties.opacity = -1;
                this.PopSuppressPropertyChanged();
            }

            this.compiledBlendOp = null;
        }
Ejemplo n.º 7
0
 protected internal GradientRenderer(bool alphaOnly, BinaryPixelOp normalBlendOp)
 {
     this.normalBlendOp = normalBlendOp;
     this.alphaOnly = alphaOnly;
 }
Ejemplo n.º 8
0
        public override void LoadProperties(object oldState, bool suppressEvents)
        {
            if (disposed)
            {
                throw new ObjectDisposedException("BitmapLayer");
            }

            List list = (List)oldState;

            // Get the base class' state, and our state
            LayerProperties baseState = (LayerProperties)list.Tail.Head;
            BitmapLayerProperties blp = (BitmapLayerProperties)(((List)oldState).Head);

            // Opacity is only couriered for compatibility with PDN v2.0 and v1.1
            // files. It should not be present in v2.1+ files (well, it'll be
            // part of the base class' serialization)
            if (blp.opacity != -1)
            {
                baseState.opacity = (byte)blp.opacity;
                blp.opacity = -1;
            }            

            // Have the base class load its properties
            base.LoadProperties(baseState, suppressEvents);

            // Now load our properties, and announce them to the world
            bool raiseBlendOp = false;

            if (blp.blendOp.GetType() != properties.blendOp.GetType())
            {
                if (!suppressEvents)
                {
                    raiseBlendOp = true;
                    OnPropertyChanging(BitmapLayerProperties.BlendOpName);
                }
            }

            this.properties = (BitmapLayerProperties)blp.Clone();
            this.compiledBlendOp = null;

            Invalidate();

            if (raiseBlendOp)
            {
                OnPropertyChanged(BitmapLayerProperties.BlendOpName);
            }
        }
Ejemplo n.º 9
0
        public void SetBlendOp(UserBlendOp blendOp)
        {
            if (disposed)
            {
                throw new ObjectDisposedException("BitmapLayer");
            }

            if (blendOp.GetType() != properties.blendOp.GetType())
            {
                OnPropertyChanging(BitmapLayerProperties.BlendOpName);
                properties.blendOp = blendOp;
                compiledBlendOp = null;
                Invalidate();
                OnPropertyChanged(BitmapLayerProperties.BlendOpName);
            }
        }
Ejemplo n.º 10
0
 protected internal LinearBase(bool alphaOnly, BinaryPixelOp normalBlendOp)
     : base(alphaOnly, normalBlendOp)
 {
 }
Ejemplo n.º 11
0
 public Swap(BinaryPixelOp swapMyArgs)
 {
     this.swapMyArgs = swapMyArgs;
 }
Ejemplo n.º 12
0
 public LinearReflected(bool alphaOnly, BinaryPixelOp normalBlendOp)
     : base(alphaOnly, normalBlendOp)
 {
 }
Ejemplo n.º 13
0
 public Conical(bool alphaOnly, BinaryPixelOp normalBlendOp)
     : base(alphaOnly, normalBlendOp)
 {
 }
Ejemplo n.º 14
0
 protected override void OnPropertyChanged(string propertyName)
 {
     compiledBlendOp = null;
     base.OnPropertyChanged (propertyName);
 }
Ejemplo n.º 15
0
 protected override void OnPropertyChanged(string propertyName)
 {
     compiledBlendOp = null;
     base.OnPropertyChanged(propertyName);
 }
Ejemplo n.º 16
0
 public Swap(BinaryPixelOp swapMyArgs)
 {
     this.swapMyArgs = swapMyArgs;
 }
Ejemplo n.º 17
0
 public LinearClamped(bool alphaOnly, BinaryPixelOp normalBlendOp)
     : base(alphaOnly, normalBlendOp)
 {
 }
Ejemplo n.º 18
0
 protected internal LinearStraight(bool alphaOnly, BinaryPixelOp normalBlendOp)
     : base(alphaOnly, normalBlendOp)
 {
 }
Ejemplo n.º 19
0
 public Conical(bool alphaOnly, BinaryPixelOp normalBlendOp)
     : base(alphaOnly, normalBlendOp)
 {
 }
Ejemplo n.º 20
0
 public LinearDiamond(bool alphaOnly, BinaryPixelOp normalBlendOp)
     : base(alphaOnly, normalBlendOp)
 {
 }
Ejemplo n.º 21
0
 protected internal GradientRenderer(bool alphaOnly, BinaryPixelOp normalBlendOp)
 {
     this.normalBlendOp = normalBlendOp;
     this.alphaOnly     = alphaOnly;
 }
Ejemplo n.º 22
0
 public LinearDiamond(bool alphaOnly, BinaryPixelOp normalBlendOp)
     : base(alphaOnly, normalBlendOp)
 {
 }