Surface Class
The Surface is a path-based drawing API. A call to CreatePath
is used to create a path, then one of StrokePath
or FillPath
is used to draw it.
This allows the users of Canvas
to optimize for animation of either the path or the stroke/fill objects independently.
This also keeps the API minimal. There are no convenience functions in this class. Those are provided via higher-level classes, such as LineSegments
or SurfaceUtil
.
Location
- Namespace
- Fuse.Drawing
- Package
- Fuse.Drawing.Surface 2.9.1
Interface of Surface
CreatePath(IList<LineSegment>, FillRule) : SurfacePath uno
Creates a pth from the provided list of segments.
Dispose uno
Frees up all resources associated with this surface. All paths and prepared objects are invalid after a call to this method. However, whethere they are actually freed now, or when Unprepare
or DisposePath
is called is undefined. This means it must always be safe to call those two fucntions, even on an disposed Surface.
DisposePath(SurfacePath) uno
Disposes of a path object created by CreatePath
.
Draw(DrawContext, Element, ISurfaceDrawable) uno
DrawLocal(ISurfaceDrawable) uno
ElementSize : float2 uno
End uno
Ends drawing. All drawing called after Begin
and to now must be completed by now. This copies the resulting image to the desired output setup in Begin
.
FillPath(SurfacePath, Brush) uno
PopTransform uno
Removes the transform added viaPushTransform
Prepare(Brush) uno
Prepares this brush for drawing. If this is called a second time with the same Brush
it indicates the properties of that brush have changed.
PushTransform(float4x4) uno
SetElementSize(float2) uno
StrokePath(SurfacePath, Stroke) uno
Unprepare(Brush) uno
Indicates the brush will no longer be used for drawing. It's resources can be freed.