This function sets up a default status procedure for reporting the status of image loading and saving.
|
Parameter |
Type |
Description |
|
lpfnStat |
STATUSPROC |
The procedure to call during the load/save operation. |
|
lCnt |
LONG |
Interval between calls to status procedure (in bytes). |
|
dwUser |
DWORD |
Any user information to be passed on to the status procedure. |
Comments
With this procedure you can easily display a thermometer-bar or some other progress indicator for image loading/saving. The dwUser parameter is any information you might want your status procedure to be able to access.
You should note that using the status procedure can have a significant impact on the loading speed of your images. If speed is an issue, turn off the status proc or set the interval (lCnt) to a large value to minimize the number of status procedure calls.
Example
// declare my status procedure like this:
int IMAPI status(HANDLE hImg, int nPercent, DWORD dwUserInfo);
.
.
// tell ImageMan to use my status procedure, calling it every
// 25000 bytes. I'll also pass in the handle of my status window.
ImgSetDefaultStatusProc(status, 25000L, (DWORD)hWndStatus);
.
.
// this function now gets called after every 25000 bytes have been
// processed by image import/export.
int IMAPI status(HANDLE hImg, int nPercent, DWORD dwUserInfo)
{
char buf[50];
HDC hDC;
// I know that dwUserInfo is the handle to my status window
wsprintf(buf,"%d%%", nPercent);
hDC = GetDC((HWND)LOWORD(dwUserInfo));
TextOut(hDC, 0, 20, buf);
ReleaseDC((HWND)Loword(dwUserInfo), hDC);
}
© 1995-2004 Data Techniques, Inc. All rights reserved.