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); } }
public static void WriteFocalGradientRGB(this ISwfStreamWriter writer, FocalGradientRGB gradient) { writer.WriteUnsignedBits((uint)gradient.SpreadMode, 2); writer.WriteUnsignedBits((uint)gradient.InterpolationMode, 2); var count = gradient.GradientRecords.Count; if (count > 15) { throw new ArgumentOutOfRangeException("gradient", "Can't serialize more them 15 gradient points"); } writer.WriteUnsignedBits((uint)count, 4); for (var i = 0; i < count; i++) { GradientRecordRGB record = gradient.GradientRecords[i]; writer.WriteGradientRecordRGB(ref record); } writer.WriteFixedPoint8(gradient.FocalPoint); }
public static void WriteSwfHeader(this ISwfStreamWriter writer, SwfHeader header) { writer.WriteRect(header.FrameSize); writer.WriteFixedPoint8(header.FrameRate); writer.WriteUInt16(header.FrameCount); }