예제 #1
0
 public static void WriteLineStyleEx(this ISwfStreamWriter writer, LineStyleEx lineStyle)
 {
     writer.WriteUInt16(lineStyle.Width);
     writer.WriteUnsignedBits((uint)lineStyle.StartCapStyle, 2);
     writer.WriteUnsignedBits((uint)lineStyle.JoinStyle, 2);
     writer.WriteBit(lineStyle.HasFill);
     writer.WriteBit(lineStyle.NoHScale);
     writer.WriteBit(lineStyle.NoVScale);
     writer.WriteBit(lineStyle.PixelHinting);
     writer.WriteUnsignedBits(lineStyle.Reserved, 5);
     writer.WriteBit(lineStyle.NoClose);
     writer.WriteUnsignedBits((uint)lineStyle.EndCapStyle, 2);
     if (lineStyle.JoinStyle == JoinStyle.Miter)
     {
         writer.WriteFixedPoint8(lineStyle.MilterLimitFactor);
     }
     if (lineStyle.HasFill)
     {
         writer.WriteFillStyleRGBA(lineStyle.FillStyle);
     }
     else
     {
         writer.WriteRGBA(lineStyle.Color);
     }
 }
예제 #2
0
 public static void WriteFillStylesRGBA(this ISwfStreamWriter writer, IList <FillStyleRGBA> styles)
 {
     if (styles.Count < 255)
     {
         writer.WriteByte((byte)styles.Count);
     }
     else
     {
         writer.WriteByte(255);
         writer.WriteUInt16((ushort)styles.Count);
     }
     foreach (var fillStyle in styles)
     {
         var style = fillStyle;
         writer.WriteFillStyleRGBA(style);
     }
 }