Click here to Skip to main content
13,594,513 members
Rate this:
Please Sign up or sign in to vote.
See more:
I am looking forward to make a rosette using c# graphics...
Here is what I'm trying to achieve:[^], of course not the lines outside the circle.
If someone can give me some lines of code and show me how this is done, I'll appreciate it. :)
Posted 8-Apr-13 3:33am
Kenneth Haugland 8-Apr-13 9:40am
Draw one circle, and 5 other circles with the same radius as the original, and spaced at equal angles?
Right, but I think OP's problem was clipping it all. Take a look at the picture: the lines are clipped by a non-rectangular region, probably my an ellipse.

I answered, please see:

It looks like a very simple exercise. What did you try so far?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

This looks nothing more than 7 circles of the same size, which can be drawn using System.Drawing.Graphics.DrawEllipse:[^].

You might see some problem in clipping of the lines by the round area. One of the method to achieve that is using the property System.Drawing.Graphics.Clip:[^].

You need to set a clip region by some region of elliptic shape of appropriate size and positioned in the center. To do so, create an instance of Region out of appropriate GraphicPath:[^],[^].

To obtain the instance of System.Drawing.Drawing2D.GraphicsPath you need, create one with its constructor and add an ellipse to it:[^],[^].

kastriotlimani 8-Apr-13 10:59am
Well, I realized that I need to know the coordinates of regular hexagon shape, then to join those points with same tension using Graphics.DrawCurve. But the problem is how to draw a regular hexagon first ...
What's the problem, elementary school mathematics, or API? Why drawing a hexagon? You need to build hexagon points only, not the hexagon itself.

Or, do you think that a clipping region is a polygon? If so, see these constructors with array of points:


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web04 | 2.8.180621.3 | Last Updated 8 Apr 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100