Questions tagged [graphicspath]

96 questions
3
votes
1 answer

Using GEO coordinates in C# to draw map

He, I want to draw a Countrymap in C# with LAT/LNG coordinates. I have to translate the lat/lng to pixels, what would be the best way? I can draw the 'Map' but it's very small and it's not in the center of the window. Can someone help? I have this…
Digital Human
  • 1,599
  • 1
  • 16
  • 26
3
votes
1 answer

C# skew text on image using GraphicsPath

I'm currently adding text to an image using the following code: using (GraphicsPath graphicsPath = new GraphicsPath()) { graphicsPath.AddString( "sample text", new FontFamily("Times New Roman"), (int)FontStyle.Bold, …
William Troup
  • 12,739
  • 21
  • 70
  • 98
3
votes
3 answers

.NET GDI+: Drawing lines with rounded corners

Given an array of points, it is easy to draw a line based on these, e.g. using the GraphicsPath class. For instance, the following array of points... [0]: (0,0) [1]: (100,0) [2]: (0,100) [3]: (100,100) ...describes a line that resembles a Z. But…
bernhof
  • 6,219
  • 2
  • 45
  • 71
3
votes
0 answers

Get path of CustomLineCap C#

How do I get information about System.Drawing.Drawing2D.CustomLineCap's paths ? I can construct CustomLineCap by giving it fillPath and strokePath: constructor - CustomLineCap(GraphicsPath, GraphicsPath). But is there any way to extract fillPath and…
2
votes
0 answers

Drawing logic gates using GraphicsPath

all. I'm working on a personal project to learn more about C#. This project consists of a logic diagram editor and I'm using a TreeView component to show to the user all the possible objects that can be created on a panel to draw the logic…
Marcelo C.
  • 23
  • 7
2
votes
1 answer

How to draw a shape using GraphicsPath to create the Region of a Custom Control?

I'm currently trying to override the OnPaint() method of a Custom Control I'm building. The object is just a simple Panel, but I'm trying to make it look a different type of way, like this: . I'm using a GraphicsPath to help me try and complete this…
user16797384
2
votes
1 answer

How to manage char spacing in GraphicsPath.AddString?

I need to change distance between characters when adding string in GraphicsPath. What is the best way to do this?
Viktor
  • 164
  • 1
  • 14
2
votes
1 answer

Strange GraphicsPath.AddArc() behaviour

I experimented with GraphicPaths and find that funny thing: DrawArc() with same ellipse width and height, but different start angle (0,90,180,270) are different Code: GraphicsPath pth = new GraphicsPath(); pth.AddArc(10, 10,…
2
votes
1 answer

A shadow created with PathGradientBrush shows undesired thorn results

I can't understand why the shadow path has thorns near the Arrow Cap. Refer to my screenshot. using (GraphicsPath _Path = new GraphicsPath()) { Point[] _Points = new Point[] { new Point { X = mouseDownX, Y = mouseDownY }, …
qtg
  • 125
  • 1
  • 11
2
votes
1 answer

WinForms: Drawing A Path In The Right Place

This is a follow-on to a question I asked here: WinForms: Measure Text With No Padding. The question is, given this code ... protected override void OnPaint(PaintEventArgs e) { e.Graphics.SmoothingMode =…
BoCoKeith
  • 817
  • 10
  • 21
2
votes
1 answer

Get the leftmost point in a rotated GraphicsPath

I create a GraphicsPath object, add a ellipse, rotate the GraphicsPath object and then draw it. Now I want to get for example the leftmost Point of the graphicsPath has so I can check if it is within certain boundaries (users can move the…
Taxen0
  • 55
  • 8
2
votes
5 answers

GraphicsPath Polygon Fitting in C#

I need to "fit" an arbitrarily shaped GraphicsPath into a defined space (almost always a Rectangle or Circle). I currently scale the GraphicsPath using the Matrix object and the scaling works fine, but the problem is getting the scale factors. The…
Flipster
  • 4,373
  • 4
  • 28
  • 36
2
votes
2 answers

Improving hit-testing in Winforms; any alternative to GraphicsPath.IsVisible?

On a custom control I've a series of LED objects that should be turned on according to a given GraphicsPath (e.g., see image below). Currently I'm using graphicsPath.IsVisible(ledPoint), however since I have many LEDs, the iteration through all of…
Mauro Ganswer
  • 1,379
  • 1
  • 19
  • 33
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
1 answer

Alternative solution to my collision detection with complex shapes?

Situation: I'm currently working on a project that requires collision detection with complex shapes: . Now the shape as a whole (The black outline) is displayed to the user as a regular image (Using Graphics.DrawImage). The image is broken down into…
Michael Chi Lam
  • 390
  • 1
  • 13