Question: How to use CompositionPathGeometry and CompositionPath?
See original GitHub issueHello,
I try to use CompositionPathGeometry like this:
IGeometrySource2D source = <...>
var pathGeometry = Compositor.CreatePathGeometry(new CompositionPath(source));
But I can’t find how to create the source (IGeometrySource2D).
Can you create an example?
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Using complex paths for CompositionClip - uwp
So the questions are: How do we use IGeometrySource2D and CompositionPath to create complex shapes? If it's not feasible, then ...
Read more >CompositionPathGeometry.Path Property - Windows
Gets or sets the data that defines the lines and curves of the path.
Read more >Composition - Ratish Philip's Blog
(Thank you, Simeon Cran, for answering my questions). ... You can now use the Win2d Mini Path Language to create CompositionPath , CompositionPathGeometry...
Read more >CompositionPathGeometry Class (Microsoft.UI.Composition)
Returns an AnimationController for the animation running on the specified property. (Inherited from CompositionObject). Applies to. Product, Versions. Windows ...
Read more >CompositionDropShadowSource...
Use the Windows.UI.Composition UWP API directly from Node.js. local_offerWindows.UI.Composition, Windows, UI, Composition, CompositionObject, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
With Windows.UI.Composition, it is done with IGeometrySource2DInterop, like in https://github.com/microsoft/Windows.UI.Composition-Win32-Samples/blob/master/cpp/HelloVectors/HelloVectors_win32.cpp, but not sure if it works with Microsoft.UI.Composition (I could only test in C# and I got 0x80070057 like @tom-huntington )
I haven’t had a chance to try raw D2D, but it can be done with Win2D. The following example works to use Win2D to build the geometry source. One possible issue with the code you pasted is that there aren’t open/add geometry/close steps being done before creating the composition path. It’s possible the d2d object defaults to a bad/closed state unless the geometry has beeen created. This code was used in a basic UWP/Win2D project: