Search code examples
c#wpfcanvasuser-controlswindows-phone-8

Path Intersection Removing excess path


Hej

Lets say I have a cirkel as my usercontrol in a Windows Phone 8 application, And I add elements inside a Geometry group, with a rectangel and a line. I would get the following:

a usercontrol
(source: c-sharpcorner.com)

I am interested in having my cirkel as the main element. To specify I want the everything else to only be displayed in the region of the cirkel. So if the rectangle was red I would only get the red corner displayed.

I have code that can manage inserting and moving objects. But I do not know how to make the intersect work opporsit of the picture.

I have tried a bit of the same in a small sample as is done in this link: the link is http://www.c-sharpcorner.com/uploadfile/mahesh/path-in-wpf/

Anybody has an idea for this?

Best So the Best solution I found is to convert your element to WriteableBitmap, and then setting this as the background of your wished shape.


Solution

  • So to acheive the above if you have the elements as geometric shapes you can use this link to get the path of the object.

    http://www.c-sharpcorner.com/uploadfile/mahesh/path-in-wpf/