66.2.2 Using Regions to Perform Hit-Testing

The example in Chapter 64, “Brushes,” uses regions to simulate a “zoomed” view of an 8-by-8 pixel monochrome bitmap. By clicking the mouse on the “pixels” in this bitmap, the user is able to create a custom brush for drawing operations. This example shows how you can use the PtInRegion function to perform hit testing and the InvertRgn function to invert the colors in a region.