PathGeometry is a class in the System.Windows.Media namespace. It represents a complex shape that may be composed of lines, arcs, points, polygons, etc. PathGeometry has several useful methods that can help in detecting overlap of shapes and overlapping areas. Also, it has methods for handling various operations necessary when working with odd shapes.
Questions tagged [pathgeometry]
126 questions
1
vote
2 answers
How to draw a circle with x mark?
I'm trying to draw a circle with perfect X mark.
I managed to draw a circle with half of the X mark. I'm not sure how to draw the second half.
Thank you

Sami
- 89
- 10
1
vote
1 answer
Add event handler (MouseDown) dynamically for PathFigure C# WPF
I created an object from points with this code, dynamically:
SolidColorBrush brushColor = (SolidColorBrush)new BrushConverter().ConvertFromString(_brushColor);
PathFigure figures = new PathFigure();
figures.StartPoint =…

dodoria1992
- 127
- 1
- 3
- 14
1
vote
1 answer
ItemPresenter messes with PathGeometry absolute position inside ItemTemplate with a Canvas ItemPanel
I have an ItemsControl with a Canvas as its ItemsPanel and Path as the ItemTemplate. The goal is to plot a graph, so the Path.Data should contain a geometry to be drawn in the Canvas with absolute coordinates.
If I instantiate a Canvas and put the…

heltonbiker
- 26,657
- 28
- 137
- 252
1
vote
1 answer
Leveraging WPF's CombinedGeometry in code
I have a requirement for 2D geometric boolean operations in a non-WPF application. I know you can use WPF assebmlies in a non-WPF application. Can the CombinedGeometry and PathGeometry object be used to perform boolean operations on geometric…

Jordan
- 9,642
- 10
- 71
- 141
1
vote
1 answer
weird issue when drawing a forth and back path in wpf
I was drawing a series of points with Path in c# code. I just give an example in xaml.
So the polyline is from (20,37) to (20,36) and returns to (20,37). It is supposed to be very short, right? But it turns to be a segment roughly 9dp long.
if I…

HDQ
- 45
- 5
1
vote
1 answer
How to use PathFigure from resources in PathGeometry?
I wonder whether is there any way to use a PathFigure from resources in PathGeometry element in xaml. Let's say I have a ResourceDictionary and a two PathFigure objects inside it with the 'x:Key' attributes equal to "Figure1" and "Figure2"…

bakala12
- 368
- 2
- 15
1
vote
0 answers
Get position of path geometry relative to it's parent
My application adds path shapes into a grid (via code-behind), that kind of resembles this:
And…

user2950509
- 1,018
- 2
- 14
- 37
1
vote
0 answers
String as Geometry
I'm trying to place a simple string inside a Rectangle. I'm using GeometryGroup for that purpose, and here is my code:
protected override Geometry DefiningGeometry
{
get
{
var geoGroup = new GeometryGroup();
var text = new…

Idanis
- 1,918
- 6
- 38
- 69
1
vote
1 answer
Creating an abitrary, curved Well Known Text LineString for display in OpenLayers
I am dynamically generating a WKT LineString between points in a map layer being generated for display in OpenLayers. I'd like to make the lines between the points curved, and I'd like to be able to dynamically change the curvature based on various…

David Eads
- 1,502
- 1
- 11
- 21
1
vote
2 answers
How to split a PathGeometry Polygon by an intersecting line segment
I've got a PathGeometry that I've built from a bunch of LineSegments, and I want to split it into two PathGeometries divided by a line intersecting down the middle of the geometry. Here's what I mean by this…

softwarequestioneer
- 991
- 1
- 8
- 16
1
vote
1 answer
Identifying geometric relationship between two rectangles
I have gotten into programming recently, and was looking for some help.
For the algorithm that I'm trying to implement, there are two rectangle grids, with each cell containing an object. You can think of it as a 2D array of with an x-y coordinate…

Caladbolgll
- 77
- 1
- 6
1
vote
2 answers
Play DoubleAnimationUsingPath in reverse
I have a WPF Storyboard (with RepeatBehavior=Forever) containing two DoubleAnimationUsingPath animations. These animations trace a circular path, which I create through adding an EllipseGeometry. One animation is used to control the X position, and…

John
- 5,452
- 8
- 37
- 37
1
vote
1 answer
Custom Fill Property on PathGeometry in Silverlight
I've been looking at (and getting confused by) Dependency Properties - I'm not sure if this is what I need or if there is something else.
I'm looking to something very specific with children in Silverlight, in particular…

Todd Main
- 28,951
- 11
- 82
- 146
1
vote
0 answers
HitTest region around a PathGeometry
I draw curves on a canvas using wpf PathGeometry's, directly via DrawingContext.
The HitTestResultBehavior shows that the bounding box of the curve is the whole rectangle enclosing the curve, i.e. TL, TR, BL, BR.
I am considering cutting the curve…

Gerard
- 13,023
- 14
- 72
- 125
1
vote
1 answer
Change path of already started DoubleAnimationUsingPath
Is it possible to change the path, e.g. the PathGeometry property, of a DoubleAnimationUsingPath while the animation is already in progress? If so, how?
Some code of mine:
XAML:

Sebastian Graf
- 3,602
- 3
- 27
- 38