Convert path to geometric shape

后端 未结 2 1548
鱼传尺愫
鱼传尺愫 2021-01-05 08:44

Hey everyone I have tried to sum up and come with the basic question and my idea which does not work so far :S

Basicly my question is: The user adds elements togethe

2条回答
  •  滥情空心
    2021-01-05 09:14

    Geometry.Parse (and as far as I can tell, it's back-end StreamGeometry) is indeed missing from the Windows Phone platform, but according to this page: http://msdn.microsoft.com/en-us/library/ms752293(v=vs.110).aspx

    WPF provides two classes that provide mini-languages for describing geometric paths: StreamGeometry and PathFigureCollection.

    PathFigureCollection is available for Windows Phone, so this looks like the place to check:

    http://msdn.microsoft.com/en-us/library/windowsphone/develop/system.windows.media.pathfigure(v=vs.105).aspx

    Now you just need to be able to create PathGeometry from the XAML-style markup. It looks like there are examples here for generating a Path from the XAML syntax:

    Convert XAML PathGeometry to WPF PathGeometry

    Windows Phone 7: How to parse Bezier Path string like in XAML?

    Basically something like

    string data = "M 100,200 C 100,25 400,350 400,175 H 280";
    Path path = XamlReader.Load("") as Path;
    

提交回复
热议问题