December 2001
Beginner
976 pages
22h 4m
English
![]() | Clipping |
Clipping allows you to ensure your drawing code does not extend outside an area that you define. Basically, you would define an area as the clipping region and then any drawing done to the drawing surface would display its output within the region and not outside the region.
To see how this works exactly, the following code sets a clipping region based on an arbitrary rectangle. Next, a string is drawn to the display surface. Figure 26.17 shows what would be displayed if no clipping region was set. Figure 26.18 shows the result of having the clipping region set. The output is as follows:
Read now
Unlock full access