public static LineStyleEx ReadLineStyleEx(this ISwfStreamReader reader) { var lineStyle = new LineStyleEx { Width = reader.ReadUInt16(), StartCapStyle = (CapStyle)reader.ReadUnsignedBits(2), JoinStyle = (JoinStyle)reader.ReadUnsignedBits(2), HasFill = reader.ReadBit(), NoHScale = reader.ReadBit(), NoVScale = reader.ReadBit(), PixelHinting = reader.ReadBit(), Reserved = (byte)reader.ReadUnsignedBits(5), NoClose = reader.ReadBit(), EndCapStyle = (CapStyle)reader.ReadUnsignedBits(2) }; if (lineStyle.JoinStyle == JoinStyle.Miter) { lineStyle.MilterLimitFactor = reader.ReadFixedPoint8(); } if (lineStyle.HasFill) { lineStyle.FillStyle = reader.ReadFillStyleRGBA(); } else { lineStyle.Color = reader.ReadRGBA(); } return(lineStyle); }
public static void ReadToFillStylesRGBA(this ISwfStreamReader reader, IList <FillStyleRGBA> fillStyles) { ushort count = reader.ReadByte(); if (count == 255) { count = reader.ReadUInt16(); } for (var i = 0; i < count; i++) { FillStyleRGBA style = reader.ReadFillStyleRGBA(); fillStyles.Add(style); } }