/// <summary> /// Creates a <see cref="CompositionPathGeometry"/> based on the given path data. /// </summary> /// <param name="compositor"><see cref="Compositor"/></param> /// <param name="pathData">Path data (Win2d Path Mini Language) in string format.</param> /// <returns><see cref="CompositionPathGeometry"/></returns> public static CompositionPathGeometry CreatePathGeometry(this Compositor compositor, string pathData) { // Create CanvasGeometry var geometry = CanvasPathGeometry.CreateGeometry(pathData); // Create CompositionPathGeometry return compositor.CreatePathGeometry(new CompositionPath(geometry)); }
/// <summary> /// Parses the specified path data and converts it to <see cref="CompositionGeometricClip"/>. /// </summary> /// <param name="compositor"><see cref="Compositor"/></param> /// <param name="pathData">Path data (Win2d Path Mini Language) in string format.</param> /// <returns><see cref="CompositionGeometricClip"/></returns> public static CompositionGeometricClip CreateGeometricClip(this Compositor compositor, string pathData) { // Create the CanvasGeometry from the path data var geometry = CanvasPathGeometry.CreateGeometry(pathData); // Create the CompositionGeometricClip return compositor.CreateGeometricClip(geometry); }
/// <summary> /// Creates a <see cref="CompositionSpriteShape"/> based on the specified path data. /// </summary> /// <param name="compositor"><see cref="Compositor"/></param> /// <param name="pathData">Path data (Win2d Path Mini Language) in string format.</param> /// <returns><see cref="CompositionSpriteShape"/></returns> public static CompositionSpriteShape CreateSpriteShape(this Compositor compositor, string pathData) { // Create CanvasGeometry var geometry = CanvasPathGeometry.CreateGeometry(pathData); // Create CompositionPathGeometry var pathGeometry = compositor.CreatePathGeometry(new CompositionPath(geometry)); // Create CompositionSpriteShape return(compositor.CreateSpriteShape(pathGeometry)); }