Ejemplo n.º 1
0
 public BevelFilter(SwfStream stream)
 {
     ShadowColor = stream.ReadRGBA();
     HighlightColor = stream.ReadRGBA();
     BlurX = stream.ReadFixed();
     BlurY = stream.ReadFixed();
     Angle = stream.ReadFixed();
     Distance = stream.ReadFixed();
     Strength = stream.ReadFixedHalf();
     mFlags = stream.ReadByte();
 }
Ejemplo n.º 2
0
        public LineStyle(SwfStream swf, bool hasAlpha, bool isExtended, int index)
        {
            Index = index;

            if (isExtended)
            {
                Width = swf.ReadUShort();
                StartCapStyle = ReadCap(swf);
                JoinStyle = ReadJoin(swf);
                HasFill = swf.ReadBit();
                NoHScale = swf.ReadBit();
                NoVScale = swf.ReadBit();
                PixelHinting = swf.ReadBit();

                swf.ReadBitUInt(5); // Reserved

                NoClose = swf.ReadBit();
                EndCapStyle = ReadCap(swf);

                if (JoinStyle == VGLineJoin.Miter)
                    MiterLimit = swf.ReadFixedHalf();

                if (HasFill)
                    Fill = new FillStyle(swf, hasAlpha, -1);
                else
                    Color = swf.ReadRGBA();
            }
            else
            {
                Width = swf.ReadUShort();
                Color = hasAlpha ? swf.ReadRGBA() : swf.ReadRGB();

                StartCapStyle = VGLineCap.Round;
                EndCapStyle = VGLineCap.Round;
                JoinStyle = VGLineJoin.Round;
                HasFill = false;
                NoHScale = false;
                NoVScale = false;
                PixelHinting = false;
                NoClose = false;
                MiterLimit = 1m;
                Fill = null;
            }

            if (Width < 1) Width = 1;
        }
Ejemplo n.º 3
0
 public GlowFilter(SwfStream stream)
 {
     GlowColor = stream.ReadRGBA();
     BlurX = stream.ReadFixed();
     BlurY = stream.ReadFixed();
     Strength = stream.ReadFixedHalf();
     mFlags = stream.ReadByte();
 }
Ejemplo n.º 4
0
 public DropShadowFilter(SwfStream stream)
 {
     DropShadowColor = stream.ReadRGBA();
     BlurX = stream.ReadFixed();
     BlurY = stream.ReadFixed();
     Angle = stream.ReadFixed();
     Distance = stream.ReadFixed();
     Strength = stream.ReadFixedHalf();
     mFlags = stream.ReadByte();
 }
Ejemplo n.º 5
0
        public ConvolutionFilter(SwfStream stream)
        {
            Width = stream.ReadByte();
            Height = stream.ReadByte();
            Divisor = stream.ReadSingle();
            Bias = stream.ReadSingle();
            Matrix = stream.ReadSingleArray(Width * Height);
            DefaultColor = stream.ReadRGBA();

            byte flags = stream.ReadByte();
            Clamp = (flags & 0x02) != 0;
            PreserveAlpha = (flags & 0x01) != 0;
        }
Ejemplo n.º 6
0
        public TextRecord(SwfStream stream, bool hasAlpha, int glyphBits, int advanceBits)
        {
            _flags = stream.ReadByte();
            if (EndRecord) return;

            if (HasFont) FontId = stream.ReadUShort();
            if (HasColor) Color = hasAlpha ? stream.ReadRGBA() : stream.ReadRGB();
            if (HasXOffset) XOffset = stream.ReadShort();
            if (HasYOffset) YOffset = stream.ReadShort();
            if (HasFont) FontSize = stream.ReadUShort();

            byte count = stream.ReadByte();
            Glyphs = new GlyphEntry[count];
            for (int i = 0; i < count; i++)
                Glyphs[i] = new GlyphEntry(stream, glyphBits, advanceBits);
        }
Ejemplo n.º 7
0
 public GradRecord(SwfStream swf, bool hasAlpha)
 {
     Ratio = swf.ReadByte();
     Color = hasAlpha ? swf.ReadRGBA() : swf.ReadRGB();
 }
Ejemplo n.º 8
0
 public virtual void Load(SwfStream stream, uint length, byte version)
 {
     CharacterID = stream.ReadUShort();
     Bounds = stream.ReadRectangle();
     Flags = (EditTextFlags)stream.ReadUShort();
     if ((Flags & EditTextFlags.HasFont) != 0) FontID = stream.ReadUShort();
     if ((Flags & EditTextFlags.HasFontClass) != 0) FontClass = stream.ReadString();
     if ((Flags & EditTextFlags.HasFont) != 0) FontHeight = stream.ReadUShort();
     TextColor = ((Flags & EditTextFlags.HasTextColor) != 0) ? stream.ReadRGBA() : (VGColor)Color.Black;
     MaxLength = ((Flags & EditTextFlags.HasMaxLength) != 0) ? stream.ReadUShort() : ushort.MaxValue;
     if ((Flags & EditTextFlags.HasLayout) != 0)
     {
         TextAlign = (Align)stream.ReadByte();
         LeftMargin = stream.ReadUShort();
         RightMargin = stream.ReadUShort();
         Indent = stream.ReadUShort();
         Leading = stream.ReadShort();
     }
     Variable = stream.ReadString();
     InitialText = ((Flags & EditTextFlags.HasText) != 0) ? stream.ReadString() : string.Empty;
 }