internal LineStyle2(SwfReader r, ShapeType shapeType) { this.Width = r.GetUI16(); this.StartCapStyle = (CapStyle)r.GetBits(2); this.JoinStyle = (JoinStyle)r.GetBits(2); this.HasFillFlag = r.GetBit(); this.NoHScaleFlag = r.GetBit(); this.NoVScaleFlag = r.GetBit(); this.PixelHintingFlag = r.GetBit(); r.GetBits(5); // skip this.NoClose = r.GetBit(); this.EndCapStyle = (CapStyle)r.GetBits(2); if (this.JoinStyle == JoinStyle.MiterJoin) { this.MiterLimitFactor = (float)((r.GetByte() / 0x100) + r.GetByte()); } if (this.HasFillFlag) { this.FillStyle = FillStyleArray.ParseFillStyle2(r, shapeType); } else { this.Color = new RGBA(r.GetByte(), r.GetByte(), r.GetByte(), r.GetByte()); } }
internal static IFillStyle ParseFillStyle2(SwfReader r, ShapeType shapeType) { IFillStyle result = null; FillType fsType = (FillType)r.GetByte(); bool useAlpha = shapeType > ShapeType.DefineShape2; switch (fsType) { case FillType.Solid: result = new SolidFill(r, useAlpha); break; case FillType.Linear: result = new Gradient(r, fsType, useAlpha); break; case FillType.Radial: result = new Gradient(r, fsType, useAlpha); break; case FillType.Focal: result = null; //throw new NotSupportedException("Currently FillType.Focal is not supported"); break; case FillType.RepeatingBitmap: case FillType.ClippedBitmap: case FillType.NSRepeatingBitmap: case FillType.NSClippedBitmap: uint charId = r.GetUI16(); Matrix bmpMatrix = new Matrix(r); result = new BitmapFill(charId, bmpMatrix, fsType); break; } return(result); }