Specifying an Area for Drawing

There are many ways to specify where you want to draw on a device. At times, you will specify specific points, such as when drawing a straight line. Other times, you will specify that a figure is to be drawn within a bounding rectangle. In this case, you will typically specify either the x and y points of the upper-left and lower-right corners of the rectangle, or you will create a RECT structure that contains these coordinates.

Often, more complex drawing areas must be defined. In these cases, Windows provides regions and paths. You can create a region based on a rectangle, ellipse, or polygon, and you can combine multiple regions to create new regions. You create a path using the BeginPath function, after which ...

Get Microsoft Windows 2000 API SuperBible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.