/*[]=====================================================================[]*/ /*[] LEADTOOLS for Windows - []*/ /*[] []*/ /*[] []*/ /*[] Copyright (c) 1991-2000 LEAD Technologies, Inc. []*/ /*[] All Rights Reserved. []*/ /*[]=====================================================================[]*/ /* maximum path name length */ #define MAXFILENAME _MAX_PATH #ifndef UNREFERENCED_PARAMETER #define UNREFERENCED_PARAMETER(P) \ { \ (P) = (P); \ } #endif typedef struct tagWINDOWDATA { HPALETTE hPalette; /* palette handle used by PaintDC */ L_INT cxClient; /* width of client area */ L_INT cyClient; /* height of client area */ L_INT cxHeight; L_INT cxWidth; L_INT nHScrollPos; /* x scroll position */ L_INT nVScrollPos; /* y scroll position */ L_INT nHScrollMax; /* maximum x scroll position */ L_INT nVScrollMax; /* maximum y scroll postion */ L_INT nHScrollStep; /* x scroll step value */ L_INT nVScrollStep; /* y scroll step value */ L_INT nScalar; RECT rcView; L_TCHAR szFilename[MAXFILENAME]; /* open bitmap filename */ L_TCHAR szImageDir[MAXFILENAME]; /* hold image directory path */ FILEINFO FileInfo; /* open bitmap FILEINFO structure */ BITMAPHANDLE Bitmap; /* open BITMAPHANDLE */ } WINDOWDATA; #define IDI_MAIN 100 #define IDM_OPEN 100 #define IDM_EXIT 103 #define IDM_ABOUT 200 #define IDM_OK 101 #define IDM_NORMAL 229 #define IDM_ZOOMIN2 230 #define IDM_ZOOMIN3 231 #define IDM_ZOOMIN4 232 #define IDM_ZOOMIN5 233 #define IDM_ZOOMIN6 234 #define IDM_ZOOMIN7 235 #define IDM_ZOOMIN8 236 #define IDM_ZOOMOUT2 237 #define IDM_ZOOMOUT3 238 #define IDM_ZOOMOUT4 239 #define IDM_ZOOMOUT5 240 #define IDM_ZOOMOUT6 241 #define IDM_ZOOMOUT7 242 #define IDM_ZOOMOUT8 243 /* maximum number of steps between scroll extremes */ #define SCROLL_RATIO 10 #define CHILDCREATELPARAM(lpCreateStruct) (((LPCREATESTRUCT) ((lpCreateStruct)->lpCreateParams))->lParam) /* useful rectangle macros */ #define RECTWIDTH(lpRect) (((LPRECT) lpRect)->right - ((LPRECT) lpRect)->left) #define RECTHEIGHT(lpRect) (((LPRECT) lpRect)->bottom - ((LPRECT) lpRect)->top) /* Data Structure */ WINDOWDATA Data; /* data type used in the program */ HWND hDlgModeless; /* handle to Modeless dialog box */ HINSTANCE hInstApp; /* instance of application */ BOOL fInScroll; /* Flag for Scrolling */ HANDLE hImageWindow; /* image window handle */ L_BOOL InitApplication (HANDLE hInstance); L_BOOL InitInstance (HANDLE hInstance, L_INT nCmdShow); LRESULT CALLBACK L_EXPORT AboutDlgProc (HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam); VOID About_OnCommand (HWND hwnd, L_INT id, HWND hwndCtl, UINT codeNotify); L_INT32 EXT_FUNCTION MainWndProc (HWND hWnd, L_UINT Message, WPARAM wParam, LPARAM lParam); VOID Window_OnHScroll (HWND hWnd, HWND hWndCtl, UINT nCode, L_INT nPos); VOID Window_OnVScroll (HWND hWnd, HWND hWndCtl, UINT nCode, L_INT nPos); VOID Window_OnSize (HWND hWnd, UINT nState, L_INT nCx, L_INT nCy); VOID Window_OnCommand (HWND hWnd, L_INT id, HWND hwndCtl, UINT codeNotify); VOID Window_OnPaletteChanged (HWND hWnd, HWND hWndPaletteChange); BOOL Window_OnQueryNewPalette (HWND hWnd); VOID Window_OnPaletteChanging(HWND hWnd, HWND hWndPaletteChange); VOID Window_SysColorChange(HWND hwnd); VOID Window_OnActivate(HWND hwnd, UINT state, HWND hwndActDeact, BOOL fMinimized); VOID Window_OnPaint (HWND hWnd); BOOL Window_OnEraseBkgnd (HWND hWnd, HDC hDC); VOID Window_OnDestroy (HWND hWnd); L_BOOL GetOpenBitmapFile (HWND hWnd, LPTSTR pFilename); L_BOOL ImageLoad (HWND hWnd, LPTSTR lpFileName); L_INT ScaleDimension (L_INT nWidth, L_INT nFactor); L_VOID Scale_Image (HWND hWnd, L_INT nScalar);