5X80 Series Software Development Kit (SDK) User’s Guide
6 - 7
LRESULT OnProgressMsg( WPARAM wParam,LPARAM lParam )
{
DWORD
dwBytesSoFar = wParam;
// Number of bytes receive to this point.
DWORD
dwBytesToRead = lParam;
// Total number of bytes expected.
return( 0 );
}
// Message Handler for image acquisition ended function (can be result of a failure as
well)
LRESULT OnEventMsg( WPARAM wParam,LPARAM lParam )
{
hhpEventTye_t eventType = (hhpEventType_t)wParam;
// Event type
DWORD
dwBytes = lParam;
// Number of bytes in
barcode. You don’t actually
use it here.
HHP_IMAGE
Image;
// Returned image structure.
TCHAR
tcErrMsg[ 128 ];
// Error message buffer
Result_t
nResult = RESULT_ERR_INTIALIZE;
// Return code
// Verify the event type is barcode
if( eventType == HHP_IMAGE_EVENT )
{
// Set the HHP_IMAGE structure size and allocate a buffer for the data, set
the buffer size and how we 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 is so there’s no overflow
Image.fileFormat = FF_BMP_GRAY;
// 8 bit bmp file format data
if( (nResult = hhpGetAsyncResult( &eventType,&Image )) == RESULT_SUCCESS )
{
// save image data to a bmp file and/or display it
}
else
{
hhpGetErrorMessage( nResult,tcErrMsg );
_tprintf( _T(“Capture Image Failed: %s\n”),tcErrMsg );
}
}
// Remember to delete your buffer
delete [ ] image.puchBuffer;
return( 0 );
}
Summary of Contents for 5080
Page 6: ...iv 5X80 Series Software Development Kit SDK User s Guide ...
Page 14: ...1 8 5X80 Series Software Development Kit SDK User s Guide ...
Page 50: ...4 14 5X80 Series Software Development Kit SDK User s Guide ...
Page 60: ...6 8 5X80 Series Software Development Kit SDK User s Guide ...
Page 62: ...7 2 5X80 Series Software Development Kit SDK User s Guide ...
Page 63: ......