Questions tagged [pathgeometry]

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.

126 questions
5
votes
7 answers

Algorithm to simplify a path

Given a path, I want to optimize it so that all verticies that are straight on a line can be removed. For example: Path: ******* * * * * *********** Could be optimized to: *-----* | \ | \ *---------* However I want to have…
jmasterx
  • 52,639
  • 96
  • 311
  • 557
5
votes
3 answers

non-GUI alternative to PathGeometry?

I've got two huge (>100000 items) collections of PathGeometry I need to compare using PathGeometry.Combine something like this: List firstList; List secondList; [...] foreach (PathGeometry pg1 in firstList) foreach…
Sam
  • 28,421
  • 49
  • 167
  • 247
4
votes
1 answer

Filling not closed PathGeometry to the bottom

Suppose I have PathGeometry, consisting of lines, like this (the rectangle == panel, for example Grid): I want to fill them to the bottom of the panel, like this: The quick and not very good solution I see is to create additional curve with 2…
Werolik
  • 923
  • 1
  • 9
  • 23
4
votes
2 answers

WPF PathGeometry - Bounds are wrong?

I've got a fairly simple…
Sam
  • 28,421
  • 49
  • 167
  • 247
4
votes
2 answers

Getting length of a PathGeometry (lines) in C#/WPF

If I have a closed path, I can use Geometry.GetArea() to approximate the area of my shape. This is great and saves me a lot of time. But is there anything around that will help me find the length of a unclosed path? The best I've been able to come…
Ross Graeber
  • 179
  • 2
  • 10
4
votes
0 answers

GetWidenedPathGeometry without Polygonal Approximation

Currently in my project, I use WPF methods like Geometry.GetWidenedPathGeometry and Geometry.GetOutlinedPathGeometry to obtain the outlines for some PathGeometries. However, these resulting geometries usually are formed by a PolyLineSegment, due to…
Igor Kondrasovas
  • 1,479
  • 4
  • 19
  • 36
4
votes
1 answer

How to add a rectangle to PathFigure WPF

I was totally tired of adding a Rectangle to a path figure. Below was my tried code, but it does not results correctly as a Rectangle: PathGeometry geom = new PathGeometry(); Geometry g = new…
Uthistran Selvaraj.
  • 558
  • 2
  • 11
  • 29
3
votes
3 answers

Position a WPF Path so that its origin is located at the bottom, center of its container

I'm trying to center a Path so that its origin (0, 0) is located at the bottom, center of its container. Assume that the container is a Grid. Example: Note: the tail of the arrow is at the origin (0, 0). The tail is centered horizontally but the…
devuxer
  • 41,681
  • 47
  • 180
  • 292
3
votes
1 answer

Pathfigure in wpf

How to get exact Pathfigure instance once we click on a Path? My Path has multiple pathFigures. I have following Xaml code:
saroj
  • 31
  • 1
  • 2
3
votes
1 answer

Split the upper edge line and lower edge line for a given cloud of points?

I have a list of 2D points x,y. And I need to find a smooth curve for the upper and lower edges (red and blue curves, correspondingly). See the picture below: Here I've found a good example, where the outer edge of x,y points is detected. Using…
Eugene W.
  • 357
  • 3
  • 11
3
votes
3 answers

How to create a WPF Path which stretches in places

I'd like to create a WPF control for a window tab, and I want it to have a particular shape. Something like this; +------------------------------+ | | * | | | …
Steve Cooper
  • 20,542
  • 15
  • 71
  • 88
3
votes
1 answer

Convert XAML PathGeometry to WPF PathGeometry

I want the PathGeometry that consist of LineSegment. So, I use this first code but it's error. PathGeometry temp = (PathGeometry)Geometry.Parse( "" + "
Hong Lim
  • 133
  • 1
  • 4
  • 12
3
votes
1 answer

How could I make geometry advanced operations on bezier paths?

I have a library that draws regular bezier path figures (complex paths formed of a lot of bezier points), using midpoint approximation. I can draw them without problem, but I need to add support for advanced geometry operations: Nearest point of a…
user214624
3
votes
1 answer

Find Control Point for QuadraticBezierSegment when given Start, End, and 1 Point lying along the bezier in C# - QuadraticBezier 3-point Interpolation

This is Similar to a previous question I asked about the Cubic Bezier. I've got a start point, an endpoint, and a point that is meant to lie along a Quadratic Bezier. Given these three points I want to be able to draw a QuadraticBezierSegment in…
softwarequestioneer
  • 991
  • 1
  • 8
  • 16
3
votes
2 answers

How to convert a Point[] til PathGeometry?

I'm trying to make a animation in WPF using data bindings. I 'm using MatrixAnimationUsingPath to let a shape follow a path. the path are representet in my viewModel as a array; Point[]. How can I bind my point property in my viwmodel so I can use…
user2590683
  • 163
  • 1
  • 1
  • 9
1
2
3
8 9