Frame Grabber SDK (Windows-C) Developer Guide
Appendix A. Sample Code
A.1 Acquire Images with Callback Function
The following sample codes show how to acquire images using callback functions.
#include <stdio.h>
#include <Windows.h>
#include <process.h>
#include <conio.h>
#include "MVFGControl.h"
#define BUFFER_NUMBER
#define FILE_NAME_LEN
3
// Number of requested buffers
256 // The maximum length of file name
// User-defined parameters.
typedef struct _Callback_UserParam_
{
DEVHANDLE
hDevice;
MV_FG_SAVE_JPEG_INFO
stSaveJpegInfo;
}Callback_User;
// Device handle
// JPEG image saving information
// Wait for key press.
void WaitForKeyPress(void)
{
while(!_kbhit())
{
Sleep(10);
}
_getch();
}
// Clear residual data from stdin.
void ClearStdin(void)
{
char c = '\0';
while (1)
{
c = getchar();
if ('\n' == c || EOF == c)
{
break;
}
}
}
65
    "