SAMPLE: DRAGBMP Demonstrates Dragging Bitmaps on the ScreenLast reviewed: February 15, 1996Article ID: Q97188 |
The information in this article applies to:
SUMMARYDRAGBMP shows how to drag images smoothly on the screen. This is achieved through the use of several bitmaps and a series of BitBlt operations. Before you can drag a bitmap, you must store the following information:
In this sample, the image is a yellow domino. Choose Draw Image! to draw the domino, then drag the domino using the mouse. Hit-testing in WM_LBUTTONDOWN determines when the domino is selected. Once selected, the dragging process begins. On each WM_MOUSEMOVE, a new background bitmap is created, the old background bitmap is restored, and the domino is moved to its new location. The WM_LBUTTONUP message ends the dragging process. (x',y') +------------------------- new position |\ | | \(dx,dy) | | \ || + . . . . . . . . . . . . . . . . . old position | .(x,y) | .
| . | .
| . | .
----.--------------------- .
. .
. .
. . . . . . . . . . . . . . . . . .
The basic steps to perform the bitmap dragging are as follows:
DRAGBMP was built and tested under Microsoft Windows version 3.1. Download DRAGBMP.EXE, a self-extracting file, from the Microsoft Software Library (MSL) on the following services:
|
Additional reference words: 3.10 softlib DRAGBMP.EXE
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |