GradientRecordCollection class
Наследование: System.Collections.CollectionBase, ISwfSerializer
Пример #1
0
        /// <summary>
        /// Reads the data.
        /// </summary>
        /// <param name="binaryReader">Binary reader.</param>
        /// <param name="shapeType">Shape type.</param>
        public void ReadData(BufferedBinaryReader binaryReader, ShapeType shapeType)
        {
            base.SetStartPoint(binaryReader);

            fillStyleType  = binaryReader.ReadByte();
            rgbColor       = null;
            gradientMatrix = null;
            bitmapId       = 0;
            bitmapMatrix   = null;
            gradient       = null;

            if (fillStyleType == (byte)FillStyleType.SolidFill)
            {
                if (shapeType == ShapeType.Shape3)
                {
                    rgbColor = new RGBA();
                    rgbColor.ReadData(binaryReader);
                }
                else if (shapeType == ShapeType.Shape2 || shapeType == ShapeType.Shape)
                {
                    rgbColor = new RGB();
                    rgbColor.ReadData(binaryReader);
                }
            }

            if (fillStyleType == (byte)FillStyleType.RadialGradientFill ||
                fillStyleType == (byte)FillStyleType.LinearGradientFill)
            {
                gradientMatrix = new Matrix();
                gradientMatrix.ReadData(binaryReader);
                gradient = new GradientRecordCollection();
                gradient.ReadData(binaryReader, shapeType);
            }

            if (fillStyleType == (byte)FillStyleType.RepeatingBitmapFill ||
                fillStyleType == (byte)FillStyleType.ClippedBitmapFill ||
                fillStyleType == (byte)FillStyleType.NonSmoothedClippedBitmap ||
                fillStyleType == (byte)FillStyleType.NonSmoothedRepeatingBitmap)
            {
                bitmapId     = binaryReader.ReadUInt16();
                bitmapMatrix = new Matrix();
                bitmapMatrix.ReadData(binaryReader);
            }

            base.SetEndPoint(binaryReader);
        }
Пример #2
0
 /// <summary>
 /// Creates a new <see cref="GradientFill"/> instance.
 /// </summary>
 /// <param name="fillStyleType">Fill style type.</param>
 /// <param name="gradientTransform">Gradient transform.</param>
 /// <param name="gradients">Gradients.</param>
 public GradientFill(byte fillStyleType, Matrix gradientTransform, GradientRecordCollection gradients)
 {
     this.gradientMatrix = gradientTransform;
     this.gradient = gradients;
     this.fillStyleType = fillStyleType;
 }
Пример #3
0
        /// <summary>
        /// Reads the data.
        /// </summary>
        /// <param name="binaryReader">Binary reader.</param>
        /// <param name="shapeType">Shape type.</param>
        public void ReadData(BufferedBinaryReader binaryReader, ShapeType shapeType)
        {
            base.SetStartPoint(binaryReader);

            fillStyleType = binaryReader.ReadByte();
            rgbColor = null;
            gradientMatrix = null;
            bitmapId = 0;
            bitmapMatrix = null;
            gradient = null;

            if (fillStyleType == (byte)FillStyleType.SolidFill)
            {
                if (shapeType == ShapeType.Shape3)
                {
                    rgbColor = new RGBA();
                    rgbColor.ReadData(binaryReader);
                }
                else if (shapeType == ShapeType.Shape2 || shapeType == ShapeType.Shape)
                {
                    rgbColor = new RGB();
                    rgbColor.ReadData(binaryReader);
                }
            }

            if (fillStyleType == (byte)FillStyleType.RadialGradientFill ||
                fillStyleType == (byte)FillStyleType.LinearGradientFill)
            {
                gradientMatrix = new Matrix();
                gradientMatrix.ReadData(binaryReader);
                gradient = new GradientRecordCollection();
                gradient.ReadData(binaryReader, shapeType);
            }

            if (fillStyleType == (byte)FillStyleType.RepeatingBitmapFill ||
                fillStyleType == (byte)FillStyleType.ClippedBitmapFill ||
                fillStyleType == (byte)FillStyleType.NonSmoothedClippedBitmap ||
                fillStyleType == (byte)FillStyleType.NonSmoothedRepeatingBitmap)
            {
                bitmapId = binaryReader.ReadUInt16();
                bitmapMatrix = new Matrix();
                bitmapMatrix.ReadData(binaryReader);
            }

            base.SetEndPoint(binaryReader);
        }
Пример #4
0
 /// <summary>
 /// Creates a new <see cref="GradientFill"/> instance.
 /// </summary>
 /// <param name="fillStyleType">Fill style type.</param>
 /// <param name="gradientTransform">Gradient transform.</param>
 /// <param name="gradients">Gradients.</param>
 public GradientFill(byte fillStyleType, Matrix gradientTransform, GradientRecordCollection gradients)
 {
     this.gradientMatrix = gradientTransform;
     this.gradient       = gradients;
     this.fillStyleType  = fillStyleType;
 }