Krzysztof Mossakowski
Windows Programming
2006 - Tasks
GDI
Version A
Ocean wave
Demonstration
Scene:
in the bottom half of the window: water drawn using bitmap from task03a_water.bmp file
in the top half of the window: sky drawn using bitmap from task03a_sky.bmp file
in the middle of the window: Bezier's curve separating water from sky, drawn using 4 points
points should be drawn as circles filled with red colour
allow to move points using left mouse button (please note only 1 point for this requirement)
Technical requirements:
no flickering (during window's resizing, repainting and points' moving)
use mouse capture to get information about dropping point outside the window
bitmaps should be loaded from files, if there is no file show a message box and terminate the application
you can assume that the number of colours in system doesn't change during application's lifetime
Hints:
GetClientRect()
LoadImage()
CreatePatternBrush(), FillRect()
PolyBezier(), MoveToEx(), LineTo()
BeginPath(), EndPath(), FillPath()
SetCapture(), ReleaseCapture()
CreateCompatibleDC(), CreateCompatibleBitmap(), SelectObject(), DeleteObject()
BitBlt()
WM_ERASEBKGND
Approximate points:
drawing water: 1.5
drawing sky: 1.5
drawing points: 1.0
drawing Bezier's curve: 2.0
separation water from sky according to the curve: 1.5
moving points: 1.0
no flickering: 1.5