Arranging items radially around a central point using C#

Started by Bolee, August 21, 2020, 10:20:36 AM

Previous topic - Next topic

Bolee

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


Richard Moss

Hello,

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.

Regards;
Richard Moss
Read "Before You Post" before posting. Do not send me private messages. Do not expect instant replies.

All responses are hand crafted. No AI involved. Possibly no I either.