Bitmap Operations

A graphics context also provides bitmap primitives allowing two ways of drawing a bitmap on a graphics device:

  • starting at a certain point, stretched or compressed to its size in twips

  • stretched or compressed to fit a rectangle of a given size and position

A linear Digital Differential Analyzer (DDA) is used when calculating bitmap stretching and compression.

Scaling a bitmap is unavoidably slow, and where possible it is better to use the faster bitmap operations provided by a bitmap graphics context, such as CBitmapContext::BitBlt() .

If the bitmap has to be scaled, consider creating a bitmap to do this off-screen. The scaled bitmap can then be blitted to the screen.