Click here to Skip to main content
15,877,857 members
Please Sign up or sign in to vote.
3.00/5 (1 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. :)
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?
Sergey Alexandrovich Kryukov 8-Apr-13 9:48am    
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:

Sergey Alexandrovich Kryukov 8-Apr-13 9:45am    
It looks like a very simple exercise. What did you try so far?

1 solution

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:[^],[^].

Share this answer
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 ...
Sergey Alexandrovich Kryukov 8-Apr-13 11:04am    
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)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900