Bitmaps, flicker free drawing
Version A
Planes and spectators scene
-
Demonstration
-
The window:
-
in the background: the image showing two planes (the image can be downloaded here)
-
in the foreground: the image showing two spectators (the image can be downloaded here, and the image mask here)
-
horizontal scroll bar
- vertical scroll bar (on the left side of the window)
-
resizeable
-
Scene drawing:
-
The planes appear behind the spectators; use mask to remove the background from the original spectators bitmap
-
The spectators are always in the bottom right corner of the scene
- Vertical scroll bar changes brightness of the spectators
-
The plane images resize according to the size of the window; the spectators are always the same size (do not resize with the window)
-
The planes move along with horizontal scroll bar (thus we have actually four planes in the scene; however only two of them are visible ate the same time)
-
Requirements:
-
all drawing should be flicker-free
-
all created GDI objects must be deleted
-
objects selected as current on DC must not be deleted
-
avoid compilation warnings
-
Hints:
-
StretchBlt(); MaskBlt(); BitBlt();
- GetPixel(); SetPixel()
-
WM_HSCROLL, WM_VSCROLL, WM_SIZE
- WS_EX_LEFTSCROLLBAR
-
Approximate points:
-
flicker-free drawing: 1.5
-
scene sizing: 1.5
-
scene scrolling: 1.5
-
displaying bitmaps: 1.5
- changing brightness of the spectators: 3.5
- vertical scroll bar on the left side of the window: 0.5