LAnnotationWindow::OnZoom

#include "ltwrappr.h"

virtual L_VOID LAnnotationWindow::OnZoom(uZoomPercent)

L_UINT uZoomPercent;

the zoom percent

This function is called whenever a zoom operation is requested on the bitmap window.

Parameter

Description

uZoomPercent

The zoom percent. The minimum value is 1.

Returns

None

Comments

Override this function to be notified of any zooming on the displayed bitmap.

A zoom can be requested by the following:

user presses one of the keys defined for zooming

user draws a rectangle while the current tool type is set to TOOL_ZOOMRECT

user clicks the mouse in the class object's window while the current tool type is set to TOOL_ZOOM_ON_MOUSECLICK

If the zoom occurs because the user has zoomed using the TOOL_ZOOMRECT tool, the zoom percent is updated. You can call LBitmapWindow::GetZoomPercent to get the zoom percent currently used to display the image.

This function is overridden by LAnnotationWindow to allow the class object to adjust zoom settings for the annotation container of the automation engine. If you override this function then you must call the parent-class implementation of this function for default processing.

Required DLLs and Libraries

LTANN
LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTSCR
LTTWN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Win32, x64.

See Also

Functions:

Class Members

Example

class LUserBWnd : public LAnnotationWindow 
 
{ 
 
public: 
 
   LUserBWnd() ; 
 
   virtual ~LUserBWnd() ; 
 
 
 
   virtual L_VOID PanWndCallBack(L_UINT uFlag,LPRECT rcPan); 
 
   virtual LRESULT MsgProcCallBack(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam); 
 
   virtual L_VOID  OnDraw(HDC hdc,RECT& Rect); 
 
   virtual L_VOID  OnZoom(L_UINT uZoomPercent); 
 
}; 
 
 
 
LUserBWnd::LUserBWnd() 
 
{ 
 
} 
 
 
 
LUserBWnd::~LUserBWnd() 
 
{ 
 
} 
 
 
 
L_VOID LUserBWnd::PanWndCallBack(L_UINT uFlag,LPRECT rcPan) 
 
{ 
 
   // user can set his code for each message 
 
   switch (uFlag) 
 
   { 
 
   case PANWIN_CREATED: 
 
      // user code  
 
      break; 
 
   case PANWIN_UPDATED: 
 
      // user code  
 
      break; 
 
   case PANWIN_DESTROYED: 
 
      // user code  
 
      break; 
 
   case PANWIN_MOVED: 
 
      // user code  
 
      break; 
 
   } 
 
 
 
LAnnotationWindow::PanWndCallBack(uFlag,rcPan); 
 
} 
 
 
 
LRESULT LUserBWnd::MsgProcCallBack(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam) 
 
{ 
 
   switch (uMsg) 
 
   { 
 
   case WM_CLOSE: 
 
      break ; 
 
   }; 
 
 
 
   return LAnnotationWindow::MsgProcCallBack(hWnd,uMsg,wParam,lParam); 
 
} 
 
 
 
L_VOID LUserBWnd::OnDraw(HDC hdc,RECT& Rect) 
 
{ 
 
   Rectangle( hdc,10,10, 50,50);  
 
LAnnotationWindow::OnDraw(hdc,Rect); 
 
} 
 
 
 
L_VOID LUserBWnd::OnZoom(L_UINT uZoomPercent) 
 
{ 
 
   L_TCHAR szBuffer[50]; 
 
   wsprintf(szBuffer,TEXT("Zoom Percent = %u\n"),uZoomPercent) ; 
 
 ::MessageBox( m_hWnd, szBuffer, TEXT("Zoom Percent"), MB_OK) ; 
 
LAnnotationWindow::OnZoom(uZoomPercent); 
 
} 
 
 
 
L_INT BitmapWindowSamples(HWND hWndParent)  
 
{ 
 
   HWND hWnd; 
 
   LUserBWnd UserBitmapWindow; 
 
 
 
   UserBitmapWindow.SetFileName(MAKE_IMAGE_PATH(TEXT("image1.cmp"))); 
 
   if (UserBitmapWindow.Load(0, ORDER_BGR) == SUCCESS) 
 
   { 
 
      hWnd = UserBitmapWindow.CreateWnd( hWndParent) ; 
 
      if (hWnd == NULL) 
 
         return 0 ; 
 
   } 
 
 
 
   return SUCCESS ; 
 
} 
Help Version 20.0.2019.9.23
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2019 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help