# Tag Archives: draw stars

## Draw stars inside polygons in C#

This example shows how to draw stars inside a polygon by connecting every M-th vertex as it draws. If the polygon has N sides and N and M are relatively prime (have no common factors except 1), then the lines … Continue reading

Posted in drawing, GDI+, graphics | | 1 Comment

## Print stars in C#

This example shows how you can print stars with specific sizes in C#. Not long ago someone contacted me asking if I knew of a program that could print stars. He wanted to create flags of different countries and needed … Continue reading

Posted in drawing, graphics, mathematics, printing | | Comments Off on Print stars in C#

## Draw a star with a given number of points in C#

My goal here was to draw a “normal” star where the interior concave angles were located at intersections of lines connecting the exterior convex points. This turned out to be a more interesting problem than I expected. There’s only one … Continue reading

Posted in algorithms, geometry, graphics, mathematics | | 2 Comments

## Draw a non-intersecting star in C#

The following NonIntersectingStarPoints method generates the points needed to draw a non-intersecting star and returns them in an array. // Return PointFs to define a non-intersecting star. private PointF[] NonIntersectingStarPoints( int num_points, Rectangle bounds) { // Make room for the … Continue reading

Posted in drawing, geometry, graphics, mathematics | | Comments Off on Draw a non-intersecting star in C#

## Draw a star in C#

The following StarPoints method generates the points needed to draw a star and returns them in an array. // Return PointFs to define a star. private PointF[] StarPoints(int num_points, Rectangle bounds) { // Make room for the points. PointF[] pts … Continue reading

Posted in drawing, geometry, graphics, mathematics | | 2 Comments