How to convert PathGeometry to StreamGeometry RRS feed

  • Question

  • Hi

    i am in need to convert the PathGeometry to StreamGeometry ("M0,0 L0,1 1,1 1,0z").

    is there any converter to achieve this.



    Warm Regards, Rams

    Monday, June 17, 2013 9:06 AM

All replies

  • There is no in-box converter. Windows.UI.Xaml does not have a StreamGeometry object to convert to.

    You could enumerate the PathGeometry and build your own.


    Tuesday, June 18, 2013 11:43 PM
  • Thanks Rob.

    Is there any way to Convert Ellipse Geometry into Path Geometry?

    Warm Regards, Rams

    Wednesday, June 19, 2013 11:52 AM
  • It depends on what you mean by convert. You can generate a PathFigure that matches your Ellipse.
    Thursday, June 20, 2013 2:07 AM
  • Hi Rob,  

    I am in need to Covert the Ellipse Geometry into "M305.772,123.75C305.772,191.819095416645,237.434535075173,247,153.136,247C68.837464924827,247,0.5,191.819095416645,0.5,123.75C0.5,55.6809045833547,68.837464924827,0.5,153.136,0.5C237.434535075173,0.5,305.772,55.6809045833547,305.772,123.75z".

    In WPF, I can achieve my requirement by using the following code.

     EllipseGeometry ellipse= new EllipseGeometry();

     PathGeometry p = PathGeometry.CreateFromGeometry(ellipse);

     string s = p.ToString();


    In WINRT,  how to achieve this.

    Please help me out.


    Warm Regards, Rams

    Thursday, June 20, 2013 4:00 AM