Skip to content

[Feature] Adding Win2d Path Mini Language Parser to WCT #3421

@ratishphilip

Description

@ratishphilip

Describe the problem this feature would solve

WPF has a Path Mini Language which is used to describe geometric paths and figures. Support for a similar language does not exist in Win2d library.

Describe the solution

In the CompositionProToolkit library, I have defined the Win2d Path Mini Language, which is a superset of the Path Language specification in SVG and can be used to define the following

  • CanvasGeometry
  • Color (in hex format or Vector4 format)
  • Various brushes deriving from ICanvasBrush
    • SolidColorBrush
    • LinearGradientBrush
    • LinearGradientBrush with GradientStopHdr
    • RadialGradientBrush
    • RadialGradientBrush with GradientStopHdr
  • CanvasStrokeStyle
  • CanvasStroke which derives from ICanvasStroke (an interface which encapsulates the attributes of a stroke - Width, Brush, Style and Transform)

Also in the CompositionProToolkit library, I have implemented a set of static helper methods which enable the parsing of Win2d Path Mini Language as string and convert them to appropriate CanvasGeometry, Color, ICanvasBrush or ICanvasStroke. Also I have added extension methods to Compositor, CanvasPathBuilder and CanvasDrawingSession to build upon the aforementioned helper methods.

My aim to integrate my library CompositionProToolkit into WCT in a series of phases.
So in the first phase I am porting the code related to Win2d Path Mini Language parsing into WCT.

Additional context

Win2d Path Mini Language Specification

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions