Copy a rectangular area of pixels between bitmaps

The blit function copies a rectangular area from a source bitmap to a destination bitmap.

The call to the blit function in Listing 4 copies the entire off-screen bitmap to the screen bitmap.

That isn't necessary, however.

A rectangular portion of a source bitmap: