Tag Archives: Region

Understand region directives in C#

Region directives let you define sections of code that you can collapse and expand by clicking the – and + signs to the left in the code window. Each region directive should have a corresponding endregion directive. You can include … Continue reading

Posted in coding, syntax | Tagged , , , , , , , , , , | 3 Comments

Make shaped PictureBoxes in C#

This example shows how to use regions to make shaped PictureBoxes. The PNG image format allows you to define transparent pixels. As you might guess, if you draw an image with transparent pixels, those pixels are not drawn and whatever … Continue reading

Posted in algorithms, geometry, graphics, image processing | Tagged , , , , , , , , , , , , , , , , , | 1 Comment

Partition an area with circles and draw each region’s count in C#

This example shows how you can partition an area with circles and determine the number of circles that contain each of the pieces. The example Find the area where circles overlap in C# explains how to find the area where … Continue reading

Posted in algorithms, geometry, graphics, mathematics | Tagged , , , , , , , , , , , , | 4 Comments

Find a Region centroid in C#

This example shows how to find a Region centroid, the point that is at the “center” of the Region. If you were to make the region out of a thin piece of wood, you could balance it at the centroid. … Continue reading

Posted in algorithms, geometry, graphics, mathematics | Tagged , , , , , , , , , , , | Leave a comment

Find the area where circles overlap in C#

This example shows how you can find the area where circles overlap in a .NET program. The example Determine where two circles intersect in C# shows how to find the points where two circles intersect. Finding the area where more … Continue reading

Posted in algorithms, geometry, graphics, mathematics | Tagged , , , , , , , , , , , , , , , | 5 Comments

Make a shaped button in C#

This example shows how to make a shaped button in a Windows Forms C# project. It uses the following Load event handler to confine a Button control to a region to give it a non-rectangular shape. // Shape the button. … Continue reading

Posted in controls | Tagged , , , , , , , , , , , | 12 Comments