Frame Grabber SDK (Windows-C) Developer Guide
if (MV_FG_SUCCESS != nRet)
{
printf("Close interface failed! %#x\n", nRet);
}
hInterface = NULL;
}
printf("Press any key to exit.\n");
WaitForKeyPress();
return 0;
}
A.4 Convert Pixel Format
The following sample codes show how to convert the format of acquired images to a desired format.
#include <stdio.h>
#include <Windows.h>
#include <process.h>
#include <conio.h>
#include "MVFGControl.h"
#define BUFFER_NUMBER
#define FILE_NAME_LEN
#define SAVE_IMAGE_NUM
#define TIMEOUT
bool g_bExit = false;
3
// Number of requested buffers
256 // The maximum length of file name
10
// The maximum number of saved images
1000 // Timeout; unit: millisecond (ms)
// Stop acquisition
// 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;
}
95
    "