Author Topic: Arranging items radially around a central point using C#  (Read 917 times)

Offline Bolee

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Arranging items radially around a central point using C#
« on: August 21, 2020, 09:20:36 AM »
Hi Richard.

I was impressed with your "Arranging items radially around a central point using C# " article and code. It reminded me of a Vb6 program I made to make polygons, but with the circles along radial midpoint lines. I guess in your code if you replace the circles with connecting lines you would produce Regular Polygons. I have uploaded what I did in Vb6. If you would like my vb6 code I can upload it to you.

I wonder if you could possibly modify your own program to produce polygons with alternating colours. I'm still learning Csharp so I am keen to learn how to do it in csharp. If it's to much work then that's ok as well. Just curious on how to do it in csharp.

Regards Eddie Bole

« Last Edit: August 21, 2020, 09:24:11 AM by Bolee »

Offline Richard Moss

  • Cyotek Team
  • Administrator
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: +25/-0
Re: Arranging items radially around a central point using C#
« Reply #1 on: August 23, 2020, 08:44:52 AM »

Unfortunately I won't have any time to update the sample to do what you request. I'm currently working on three different blog posts and sample applications (one of which is pretty complex) so I don't have the time to spare. Not to mention, I usually have to spent a lot of time on maths based samples as it really isn't my strong point. I did realise when taking a quick look at the source that I never released the second part of that sample, I'll have to add that to my todo list!

If you already have source code you wrote in VB6 then you should be able to use the same principles in C# - maths is maths whatever the language after all. Specifically in regards to drawing, you should look at the Graphics class, probably the DrawPolygon and FillPolygon methods, which can be used to outline or fill a shape based on the points.

Richard Moss