APX-3302 User's Manual (OM110000019A)
-37 -
5.2.2 Grab (Streaming)
The programming example of Grab (Streaming) is shown as below.
<Sample code>
#include
<stdio.h>
#include
<conio.h>
#include
"AcapLib2.h"
#pragma comment
(
lib
,
"AcapLib2.lib"
)
#define
INPUT_CH 1
#define
CAM_LINE 1
void
CALLBACK GrabCallbackFunc(
int
nChannel, DWORD dwEvent,
int
nParam1,
int
nParam2);
PUCHAR pUserBuffer[4];
int
nXSize, nYSize, nBoardBit;
int
main(
int
argc,
char
*argv[])
{
HANDLE hDev;
int
nCount;
int
nCamera;
int
nCycle, nScan;
DWORD dwEventMask;
ACAPBOARDINFO abi;
// Get board (frame-grabber) information
AcapGetBoardInfo (&abi);)
// Open device
hDev = AcapOpen(abi.BOARDINDEX[0].pBoardName, abi.BOARDINDEX[0].nBoardID, INPUT_CH);
// Initialize by ini file.
AcapSelectFile(hDev, INPUT_CH,
"Default.ini"
, 0);
// Check camera type
AcapGetInfo (hDev, INPUT_CH, ACL_SCAN_SYSTEM, 0, &nCamera);)
if
(nCamera == CAM_LINE){
// If the camera is Line sensor, confirm that exposure setting is performed.
AcapGetInfo (hDev, INPUT_CH, ACL_EXP_CYCLE, 0, &nCycle);)
AcapGetInfo (hDev, INPUT_CH, ACL_EXPOSURE, 0, &nScan);)
if
((nCycle == 0) || (nScan == 0)){
printf (
"exposure setting out is injustice ¥n"
);
return
0;
}
}
// Set the number of memory as 4 frames for each ch
AcapSetInfo(hDev, INPUT_CH, ACL_MEM_NUM, 0, 4);
Summary of Contents for APX-3302
Page 1: ...APX 3302 User s Manual ...