Bitmap Dimensions

A bitmap is rectangular and has a spatial dimension, which is the width and height of the image in pixels. For example, this grid could represent a very small bitmap that is 9 pixels wide and 6 pixels high or, more concisely, 9 by 6:

image with no caption

By convention, the shorthand dimension of a bitmap is given with the width first. This bitmap has a total of 9 x 6, or 54, pixels. I’ll often use the symbols cx and cy to refer to the width and height of a bitmap. The ‘c’ stands for count, so cx and cy are the number of pixels along the x (horizontal) and y (vertical) axes.

We can indicate a particular pixel of the bitmap in terms of x and y coordinates. ...

Get Programming Windows®, Fifth Edition 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.