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
3
votes
1 answer

Why converting a string path to Geometry and back again throws a FormatException?

I need to convert a string path to a Geometry and back again. The first step is to convert my path: "M 100 100 L 300 100 L 200 300 z". To do this I use the Geoemtry.Path method, that creates a new Geometry instance from the specified string: var…
gliderkite
  • 8,828
  • 6
  • 44
  • 80
3
votes
2 answers

Why can't I define a Geometry with a Transform in XAML?

I am trying to create a ResourceDictionary á la this answer that contains StreamGeometries that have Transforms set:
Kian
  • 1,260
  • 1
  • 13
  • 32
3
votes
1 answer

remove a point/operation from java.awt.geom.GeneralPath

Is there any way to remove a point of a generalpath ? I draw a GeneralPath as follow : GeneralPath gp1=new GeneralPath(); gp1.moveTo(5,5); gp1.lineTo(10,10); gp1.lineto(10,30); gp1.curveTo(2, 2, 7, 7, 5, 5); gp1.closePath(); Now I would like to…
mcfly soft
  • 11,289
  • 26
  • 98
  • 202
2
votes
2 answers

Tangent at a point on a PathGeometry

GetPointAtFractionLength pathGeometry.GetPointAtFractionLength(progress, out point, out tangent); GetPointAtFractionLength gives a point on the pathgeometry and a tangent at that point if factional length is given. I have the point already but I…
Sam
  • 933
  • 5
  • 14
  • 26
2
votes
2 answers

Source for basic Shapes in WPF

Does anybody know if there is some online source where one can download basic shapes such as the minimize/ maximize glyph, a star geometry or the Visual Studio pin glyph as WPF GEometry Path?
Oliver Vogel
  • 1,988
  • 1
  • 20
  • 33
2
votes
0 answers

GetPointAtFractionLength - how to check if path is correct

I was wondering if there is any way to check the validity of an object of PathGeometry. I need to use GetPointAtFractionLength to get some point at the path, however for some paths this function throws an exception: Value does not fall within the…
commando
  • 235
  • 1
  • 3
  • 6
2
votes
1 answer

Rotation and Direction of ArcSegment

Is there a way to get an ArcSegment to draw in a particular direction? As far as I can tell, it is always drawing top to bottom to top. For example, I have an ArcSegment which starts at 180 degrees (270 degrees is north) and draws an almost ellipse…
Todd Main
  • 28,951
  • 11
  • 82
  • 146
2
votes
1 answer

How to dynamically change a PATH DATA property at runtime in XAML?

I have a button with a custom ControlTemplate. During execution, I want to change the PathGeometry and Fill based on criteria the user selects. In a ResourceDictionary I have two PathGeometry definitions:
cce1911
  • 363
  • 3
  • 20
2
votes
1 answer

How can I get paths in a WPF GeometryGroup correctly aligned?

I am using a GeometryGroup to draw a symbol in the center of a circle. The example below shows one of my attempts while experimenting with this. It features three straight lines that depart from the same point of origin (32,32):
Alex
  • 13,024
  • 33
  • 62
2
votes
2 answers

Correctly split a System.Windows.Media.PathGeometry

I have a single System.Windows.Media.PathGeometry like that: And I would like to split the geometry, so that each gray shape is in a new Geometry object. I have tried to iterate over the FigureColletion of the PathGeometry and put each figure in a…
Timo
  • 9,269
  • 2
  • 28
  • 58
2
votes
1 answer

What's the opposite of polygon triangulation?

After I've done a 2D triangulation, some triangles have the same color and I want to recombine them for drawing into like-colored graphics paths. I find that if I just draw the triangles one by one, some graphic renderers shows seams between the…
2
votes
2 answers

Whats an easy way to fill a Concave PathGeometry to be Convex (finding the concave vertices & removing them)?

I've got a PathGeometry (polygon) built up of LineSegments on one PathFigure and I'd like to ensure that it's Convex. I have a method using the CrossProduct to determine whether the geometry is Convex, I was assuming that I could just return back a…
softwarequestioneer
  • 991
  • 1
  • 8
  • 16
2
votes
0 answers

Programmatically distorting text in Windows Phone

I am trying to programmatically draw a distorted string of text with C# using different sets of APIs (WinForms, WPF, and Windows Phone 8). Using WinForms, I managed to achieve this with GDI+'s System.Drawing.Drawing2D.GraphicsPath class this…
user3079266
2
votes
1 answer

Geometry.Combine gives odd result on intersecting geometry objects

I have this two geometries: StreamGeometry geo1 =…
gumo
  • 645
  • 15
  • 35
2
votes
1 answer

StrokeStartLineCap not set when PathGeometry is bound

XAML produces the expected result: a line with rounded ends. However, data binding the same PathGeometry produces flat ends. I'm not sure why this is, can anyone explain? Here is a simplified example: XAML:
1 2
3
8 9