This user provided function is called between the effect operation at intervals specified by the nInterval parameter in ImgDrawImageFX. You use this function for such things as showing display progress. You can also use it to cancel an effect that is currently being drawn. It shares the same format as ImageMan's STATUSPROC for your convenience.
The callback function should return a value of zero if it wants the effect to continue otherwise it should return a non-zero value which will cause the ImgDrawImageFX function to terminate. The return value of the callback will be returned from the ImgDrawImageFX function.
Declare your callback function like this:
int EXPORT IMAPI MyCallBack ( HANDLE hImage, UINT nPercent, DWORD dwUserInfo)
{
// do something here like update a status bar
// or maybe check for some event like a cancel button that got clicked
return 0 ;
}
And, use it like this:
ImgDrawImageFX(hImage, hDC, &rect, NULL, IMFX_MOSAIC, 0, 0, MyCallBack, 5, IDC_PROGRESS1, hPal);
The callback interval is specified as 5% in the above sample. This means that the callback function will be called every time 5% of the effect has processed. The sample also uses the dwUserInfo parameter to pass the ID of the control to be updated. That parameter can be used to pass any value to the callback.
© 1995-2004 Data Techniques, Inc. All rights reserved.