
5X80 Series Software Development Kit (SDK) User’s Guide
6 - 5
Image Capture
Sample 7 - A synchronous image capture
// Capture image specifies:
for capture - Photo Mode and Lights On During Frames.
for Transfer - Subsample value of 1 and Lossless transfer.
Note: You don’t really have to pass anything except the HHP_IMAGE structure as long as you
want the imager config settings for capture and transfer. Also, no progress feedback will
be received.
HHP_IMAGE
image;
// Structure to hold captured image
HHP_IMAGE_TRANSFER
imgTrans;
// Image transfer options (override
imager config)
// Image capture options (override
imager config)
TCHAR
tcErrMsg[ 128 ];
// Error message buffer
Result_t
nResult = RESULT_ERR_INTIALIZE;
// Return code
// Make sure to set imgAcqu structure size!
imgAcqu.dwStructSize = sizeof( HHP_IMAGE_ACQUISITION );
// Set the mask to activate captureMode and illuminatCycle (lights).
ImgAcqu.dwMask = (ILLUMINATION_DUTY_CYCLE_MASK | IMAGE_CAPTURE_MODE_MASK);
// Set values
ImgAcqu.captureMode = HHP_AUTOEXPOSURE_PHOTO;
ImgAcqu. IlluminatCycle = HHP_DUTY_CYCLE_ON;
// Make sure to set imgTrans structure size!
imgTrans.dwStructSize = sizeof( HHP_IMAGE_TRANSFER );
// Set the subsample and compression masks.
ImgTrans.dwMask = (SUBSAMPLE_VALUE_MASK | COMPRESSION_MODE_MASK);
// Set values
imgTrans.dwSubSample = 1;
imgTrans. compressionMode = COMPRESSION_LOSSLESS;
// Set the HHP_IMAGE structure size and allocate a buffer for the data, set the buffer
size and how you want to receive the data in the buffer.
Image.dwStructSize = sizeof( HHP_IMAGE );
Image.puchBuffer = new BYTE[ 324000 ];
// Allocate a buffer big enough to hold 640x480x8
plus header (if BMP)
Image.nBufferSize = 324000;
// SDK wants to know how big the buffer so no
overflow.
Image.fileFormat = FF_RAW_GRAY;
// 8 bit raw data.
// Call the SDK function to capture an image setting the bWait parameter to TRUE for
blocking/synchronous behavior.
if ( (nResult = hhpAcquireImage( &image,&imgTrans, &imgAcqu,TRUE ) == RESULT_SUCCESS )
{
// Display the image. NOTE: you could specify FF_BMP_GRAY. The data would come
as a BMP file.
}
else
{
hhpGetErrorMessage( nResult,tcErrMsg );
Содержание 5080
Страница 1: ...Software Development Kit SDK for 5080 5180 and 5380 Decoded Miniature Image Scan Engines User s Guide ...
Страница 6: ...iv 5X80 Series Software Development Kit SDK User s Guide ...
Страница 14: ...1 8 5X80 Series Software Development Kit SDK User s Guide ...
Страница 50: ...4 14 5X80 Series Software Development Kit SDK User s Guide ...
Страница 60: ...6 8 5X80 Series Software Development Kit SDK User s Guide ...
Страница 62: ...7 2 5X80 Series Software Development Kit SDK User s Guide ...
Страница 63: ......
Страница 64: ... Hand Held Products Inc 700 Visions Drive P O Box 208 Skaneateles Falls NY 13153 0208 5X10 80SDK UG Rev C 9 07 ...