CurveEdge record.
SWF differs from most vector file formats by using Quadratic Bezier
curves rather than Cubic Bezier curves. PostScript uses Cubic Beziers,
as do most drawing applications, such as Illustrator, FreeHand and Corel Draw.
SWF uses Quadratic Bezier curves because they can be stored more compactly,
and can be rendered more efficiently.
A Quadratic Bezier curve has 3 points. Two on-curve anchor points, and one off-curve
control point. A Cubic Bezier curve has 4 points. Two on-curve anchor points,
and two off-curve control points.
The curved-edge record stores the edge as two X-Y deltas.
The three points that define the Quadratic Bezier are calculated like this:
- The first anchor point is the current drawing position.
- The control point is the current drawing position + ControlDelta.
- The last anchor point is the current drawing position + ControlDelta + AnchorDelta.
The last anchor point becomes the current drawing position.
author: Dmitry Skavish |