User manual - イメージャライブラリマニュアルver.1.06(2012年3月29日)
Table Of Contents
- 概要
- 動作環境
- 関数
- IMGInit
- IMGDeinit
- IMGConnect
- IMGDisconnect
- IMGSetDecodeMode
- IMGGetDecodeMode
- IMGWaitForDecode
- IMGWaitForDecodeRaw
- IMGStopDecode
- IMGSetDecodeWindow
- IMGGetDecodeWindow
- IMGSetDecodeReverse
- IMGGetDecodeReverse
- IMGGetImage
- IMGStartStream
- IMGGetStreamData
- IMGStopStream
- IMGCaptureSign
- IMGSetAusPost
- IMGGetAusPost
- IMGSetAztec
- IMGGetAztec
- IMGSetBPO
- IMGGetBPO
- IMGSetCanPost
- IMGGetCanPost
- IMGSetCodabar
- IMGGetCodabar
- IMGSetCodablock
- IMGGetCodablock
- IMGSetCode11
- IMGGetCode11
- IMGSetCode128
- IMGGetCode128
- IMGSetCode32
- IMGGetCode32
- IMGSetCode39
- IMGGetCode39
- IMGSetCode49
- IMGGetCode49
- IMGSetCode93
- IMGGetCode93
- IMGSetComposite
- IMGGetComposite
- IMGSetDataMatrix
- IMGGetDataMatrix
- IMGSetDutchPost
- IMGGetDutchPost
- IMGSetEAN13
- IMGGetEAN13
- IMGSetEAN8
- IMGGetEAN8
- IMGSetHX
- IMGGetHX
- IMGSetIATA
- IMGGetIATA
- IMGSetITF
- IMGGetITF
- IMGSetISBT
- IMGGetISBT
- IMGSetMaxicode
- IMGGetMaxicode
- IMGSetMicroPDF
- IMGGetMicroPDF
- IMGSetMSI
- IMGGetMSI
- IMGSetOCR
- IMGGetOCR
- IMGSetPDF417
- IMGGetPDF417
- IMGSetPlanet
- IMGGetPlanet
- IMGSetPostnet
- IMGGetPostnet
- IMGSetQR
- IMGGetQR
- IMGSetRSS
- IMGGetRSS
- IMGSetTLC39
- IMGGetTLC39
- IMGSetUPCA
- IMGGetUPCA
- IMGSetUPCE
- IMGGetUPCE
- IMGSetMesa
- IMGGetMesa
- IMGSetJaPost
- IMGGetJaPost
- IMGAimerOn
- IMGIlluminationOn
- IMGSetAimer
- IMGGetAimer
- IMGSetIllumination
- IMGGetIllumination
- IMGSetIlluminationEx
- IMGGetIlluminationEx
- IMGSetScanMode
- IMGGetScanMode
- IMGSetImagerAPO
- IMGGetImagerAPO
- IMGSetPrintWeight
- IMGGetPrintWeight
- IMGSetLED
- IMGGetLED
- IMGSetBuzzer
- IMGGetBuzzer
- IMGSetVibrator
- IMGGetVibrator
- IMGSetDeliberation
- IMGGetDeliberation
- IMGSetDecodeCenteringWindow
- IMGGetDecodeCenteringWindow
- IMGLoadConfigFile
- IMGSaveConfigFile
- IMGMakeImageFile
- IMGSetDecodePreview
- IMGGetDecodePreview
- IMGStartPreview
- IMGStopPreview
- IMGSetFocus
- IMGGetFocus
- プログラミング上の注意点
- サンプルソースコード

226
5.2 デコード処理 (任意のタイミングでデコードを中断する場合)
この例では、"Start"ボタンが押されるとデコードを開始し、"Stop"ボタンが押されると中断します。デコード
した結果は画面のエディットボックス上に表示されます。
#define IDC_BTNSTART 101
#define IDC_BTNSTOP 102
#define VKEY_CLR VK_DELETE // Virtual Key of CLR key
DWORD WINAPI DecodeThread( LPVOID);
HANDLE g_hDecodeEvent[ 2];
HWND g_hEditMessage;
LRESULT CALLBACK WndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static HWND hBtnStart, hBtnStop;
static HANDLE hDecodeThread;
DWORD dwID;
switch ( message)
{
case WM_COMMAND:
switch( LOWORD( wParam))
{
case IDC_BTNSTART:
SetEvent( g_hDecodeEvent[ 0]);
break;
case IDC_BTNSTOP:
IMGStopDecode();
break;
}
break;
case WM_CREATE:
...
g_hEditMessage = CreateWindow( TEXT( "edit"), NULL,
WS_CHILD | WS_VISIBLE | WS_BORDER | ES_MULTILINE,
8, 30, 96, 40, hWnd, ( HMENU)1, hInst, NULL);
hBtnStart = CreateWindow( TEXT("button"), TEXT("Start"),
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
8, 80, 40, 20, hWnd, ( HMENU)IDC_BTNSTART, hInst, NULL);
hBtnStop = CreateWindow( TEXT("button"), TEXT("Stop"),
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
64, 80, 40, 20, hWnd, ( HMENU)IDC_BTNSTOP, hInst, NULL);
g_hDecodeEvent[ 0] = CreateEvent( NULL, FALSE, FALSE, TEXT("StartDecode"));
g_hDecodeEvent[ 1] = CreateEvent( NULL, FALSE, FALSE, TEXT("Quit"));
hDecodeThread = CreateThread( NULL, 0, DecodeThread, NULL, 0, &dwID);
IMGInit();
IMGConnect();
IMGSetEAN13( TRUE, FALSE, FALSE, FALSE, TRUE, TRUE);