O'Reilly logo

Graphics Programming with GDI+ by Mahesh Chand

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

15.2. Drawing Shaped Forms and Windows Controls

Normally, all Windows controls and forms are rectangular, but what if we want to draw them in nonrectangular shapes? We can do this by setting the Region property. The Region property of a form or a control represents that window’s region, which is a collection of pixels within a form or control where the operating system permits drawing; no portion of a form that lies outside of the window region is displayed. To draw nonrectangular shapes, we trick the system into drawing only the region of a control.

Let’s draw a circular form. We can use the GraphicsPath class to draw graphics paths. In this application we’ll create a circular form and a circular picture box, which will display an image. To ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required