Article ID: 97188 - Last Review: February 11, 2005 - Revision: 2.4 DRAGBMP Demonstrates Dragging Bitmaps on the ScreenThis article was previously published under Q97188 SUMMARY
DRAGBMP shows how to drag images smoothly on the screen. This is achieved
through the use of several bitmaps and a series of BitBlt operations.
MORE INFORMATIONThe following files are available for download from the Microsoft
Download Center: Dragbmp.exe (http://download.microsoft.com/download/platformsdk/demo2/3.1/w31/en-us/dragbmp.exe) For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base: 119591
(http://support.microsoft.com/kb/119591/EN-US/
)
How to Obtain Microsoft Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.
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) | .
| . | .
| . | .
----.--------------------- .
. .
. .
. . . . . . . . . . . . . . . . . .
DRAGBMP was built and tested under Microsoft Windows version 3.1. | Article Translations
|

Back to the top
