beautypg.com

Sensoray 711 User Manual

Page 22

background image

Sensoray Model 711 Instruction Manual

23

X11_FreeBuffer has to be called in case the image buffer is reallocated (e.g. if the image
format is changed). It is not necessary to call X11_FreeBuffer when the application is
terminated, because X11_CloseSystem releases the buffer resources.

Example
PCI pci;
ECODE ecode;
MODE mode = {DEF_MODE_NTSC};
BUFFER buffer;

if (!(ecode = X11_InitSystem (&pci))) {
if (!(ecode = X11_AllocBuffer (&mode, &buffer, 1))) {
/* application code here */
/* now we change the scaling */
mode.scale = SCALE2;
X11_FreeBuffer (buffer.hbuf);
/* re-allocate the buffer */
if (!(ecode = X11_AllocBuffer (&mode, &buffer, 1))) {
/* application code here */
} else {
return ecode;
}
} else {
return ecode;
}
} else {
return ecode;
}

X11_Acquire

__declspec(dllimport) ECODE __stdcall X11_Acquire (hfg, hbuf, timeout, pStatus)

HFG hfg;

/* frame grabber handle */

HBUF hbuf;

/* image buffer handle */

float timeout;

/* acquisition timeout, sec */

DWORD * pStatus;

/* address of the variable receiving status value */

The X11_Acquire function grabs the number of frames corresponding to that of the image
buffer.
Parameter Description

hfg

Frame grabber handle. Selects the frame grabber.

hbuf

Image buffer handle. Selects the image buffer. All frames of the
image buffer are filled with data following one call to X11_Acquire.
See BUFFER and X11_AllocBuffer.

timeout

Acquisition timeout in seconds. The function returns if the

acquisition is not completed after timeout seconds.

pStatus

Address of the variable receiving the status value. The

individual bits

are set if a corresponding condition occurs during the acquisition
of any frame of the image buffer.