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
0
votes
1 answer
Wpf custom geometry scaling
I am working on a very simple game in WPF (I know that wpf is not designed for games, but I do it for fun). I have an Enemy class which derives from CustomControl. I wrote a piece of code with the template for this control.
here is the code:
…

bakala12
- 368
- 2
- 15
0
votes
1 answer
Preview actual image of PathGeometry in WPF MVVM
In my application there is a common Icon.xaml file which contains many PathGeometry Figures having unique key names like as shown below.

Sagar Shirke
- 648
- 9
- 32
0
votes
2 answers
Convert DrawingImage into Geometry
I have several DrawingImages that were created in a ResourceDictionary (in a .xaml file).
I also have a 'Path', that I want to set its 'Data' property.
So, I want to 1) Get access to a Resource 2) Cast it to DrawingImage 3) Manipulate it to the…

user3281625
- 21
- 2
0
votes
1 answer
WPF ButtonStyle with PathGeometry as an icon
How I can add PathGeometry as an Icon to the style of the button/radbutton?
In resources I have for example:
F1 M 22,19L 24,19L 24,57L 22,57L 22,19 Z M 26,57L 26,19.0001L 53.9999,19.0001L 53.9999,57L 26,57 Z M…

tauri
- 293
- 2
- 6
- 18
0
votes
2 answers
PathGeometry FillContains not working as expected
I have a simple rectangular PathGeometry and want to test if the point is inside the PathGeometry. The obvious way is to call FillContains but it doesn't work as expected. There is also an overload function which has a tolerance parameter, although…

Mohsen Afshin
- 13,273
- 10
- 65
- 90
0
votes
2 answers
How to connect a line between 4 randomly placed points on a plane such that the line does not cross itself
You get 4 coordinates of points on a plain.
You need to connect them all with a line. The line must not cross itself.
What's your strategy?
See image
My first intuition was to organize the points as "Top left", "Top right", "Bottom left" and…

Michael Seltenreich
- 3,013
- 2
- 29
- 55
0
votes
0 answers
WPF PathGeometry is displaced in DoubleAnimationUsingPath
so i'm new to WPF and haven't the faintest idea why this doesn't work. I wanna do a DoublePathAnimation on a Ellipse. So i used a PathObject to just simple find out which PathGeometry Figures i need.
…

ADope Reader
- 1
- 2
0
votes
1 answer
Get Widened Path Geometry with flat line joins
There is a good discussion about getting a widened path geometry on this thread:
Create a polygon around a polyline like a buffer
In my case, I would like to have the resulting outer line not "rounded", but totally flat. Is that Possible?
I tried to…

Igor Kondrasovas
- 1,479
- 4
- 19
- 36
0
votes
1 answer
c# wpf rotate animation for pie slice (drawn using PathGeometry)
Is there anyway for me to have a rotate animation for a PathGeometry that consists of arc and line segments (a pie) from angle A to angle B?
The PathGeometry is drawn using c# instead of xaml, so answers in c# instead of xaml will be appreciated and…

Xeon
- 246
- 3
- 15
0
votes
1 answer
Hex PathGeometry fill instead of drawing border only
I have a descendent of FrameworkElement with the following methods:
class HexVisual : FrameworkElement {
/* ... */
private PathGeometry GetHexGeometry(Hexagon Hexagon) {
var geometry = default(PathGeometry);
…

IAbstract
- 19,551
- 15
- 98
- 146
0
votes
1 answer
Problems binding a string to Path.Data using UniversalValueConverter (or any converter)
I'm trying to use a string property to update the path data, using a ValueConverter. I think the easiest way is just to show it: (I'm using WPF and MVVM pattern. Also using MVVM Light)
In my ViewModel:
private string _icon = "F1 M…

user2590683
- 163
- 1
- 1
- 9
0
votes
1 answer
Opacity Masks in WPF - Excluding Shapes
I'm currently creating a PDF viewer of sorts that, if the user moves their cursor over one of a number of areas of interest on the current slide (defined in an external file), the rest of the slide will darken, highlighting that area.
Currently,…

Dan McElroy
- 426
- 4
- 19
0
votes
2 answers
Change element location WPF
How can I change the location element (Line) in C# code?

user2204438
- 61
- 2
- 7
0
votes
1 answer
EllipseGeometry is not rendering in Silverlight
I'm trying to draw a circle in WP7 Silverlight using EllipseGeometry instead of Ellipse. The sample XAML in MSDN does not display anything on the canvas in Visual Studio. If I run the app, it does display in the emulator.
0
votes
1 answer
new PathGeometry() throws TypeInitializationException?
I've got a program which is doing some geometrical analysis in a background thread.
Usually this worked quite well, but surprisingly now I get an exception when trying to create a PathGeometry on my development computer:
So on the simple…

Sam
- 28,421
- 49
- 167
- 247