RGB
Inheritance: RGBColor
 /// <summary>
 /// Creates a new <see cref="SetBackgroundColorTag"/> instance.
 /// </summary>
 /// <param name="rgbColor">Color of the RGB.</param>
 public SetBackgroundColorTag(RGB rgbColor)
 {
     this.rgb = rgbColor;
     this._tagCode = (int)TagCodeEnum.SetBackgroundColor;
 }
Example #2
0
 /// <summary>
 /// Creates a new <see cref="SolidFill"/> instance.
 /// </summary>
 /// <param name="fillColor">Color of the fill.</param>
 public SolidFill(RGB fillColor)
 {
     this.rgbColor = fillColor;
     fillStyleType = (byte)FillStyleType.SolidFill;
 }
        /// <summary>
        /// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
        /// </summary>
        public override void ReadData(byte version, BufferedBinaryReader binaryReader)
        {
            RecordHeader rh = new RecordHeader();
            rh.ReadData(binaryReader);

            rgb = new RGB();
            rgb.ReadData(binaryReader);
        }
 /// <summary>
 /// Creates a new <see cref="SetBackgroundColorTag"/> instance.
 /// </summary>
 /// <param name="red">Red.</param>
 /// <param name="green">Green.</param>
 /// <param name="blue">Blue.</param>
 public SetBackgroundColorTag(byte red, byte green, byte blue)
 {
     this.rgb = new RGB(red, green, blue);
     this._tagCode = (int)TagCodeEnum.SetBackgroundColor;
 }
Example #5
0
        /// <summary>
        /// Reads the data.
        /// </summary>
        /// <param name="reader">Reader.</param>
        /// <param name="bitmapColorTableSize">Size of the bitmap color table.</param>
        /// <param name="bitmapWidth">Width of the bitmap.</param>
        /// <param name="bitmapHeight">Height of the bitmap.</param>
        /// <param name="toRead">To read.</param>
        public void ReadData(BufferedBinaryReader reader, byte bitmapColorTableSize, 
			ushort bitmapWidth, ushort bitmapHeight, int toRead)
        {
            int size = ((bitmapColorTableSize + 1) * 3) + (bitmapWidth * bitmapHeight);
            byte[] uncompressed = new byte[size];

            byte[] compressed = reader.ReadBytes(toRead);
            Inflater zipInflator = 	new Inflater();
            zipInflator.SetInput(compressed);
            zipInflator.Inflate(uncompressed, 0, size);

            int readed = 0;
            int offset = size;

            colorTableRGB = new RGB[bitmapColorTableSize + 1];
            for (int i = 0; i < bitmapColorTableSize + 1; i++)
            {
                byte red = uncompressed[readed];
                readed++;
                byte green = uncompressed[readed];
                readed++;
                byte blue = uncompressed[readed];
                readed++;
                colorTableRGB[i] = new RGB(red, green, blue);
                offset -= 3;
            }

            colorMapPixelData = new byte[offset];
            for (int i = 0; i < offset; i++, readed++)
                colorMapPixelData[i] = uncompressed[readed];
        }
Example #6
0
 /// <summary>
 /// Creates a new <see cref="ColorMapData"/> instance.
 /// </summary>
 /// <param name="colorTableRGB">Color table RGB.</param>
 /// <param name="colorMapPixelData">Color map pixel data.</param>
 public ColorMapData(RGB[] colorTableRGB, byte[] colorMapPixelData)
 {
     this.colorTableRGB = colorTableRGB;
     this.colorMapPixelData = colorMapPixelData;
 }
Example #7
0
 /// <summary>
 /// Creates a new <see cref="SolidFill"/> instance.
 /// </summary>
 /// <param name="fillColor">Color of the fill.</param>
 public SolidFill(RGB fillColor)
 {
     this.rgbColor = fillColor;
     fillStyleType = (byte)FillStyleType.SolidFill;
 }