LAnnotationWindow::OnZoom

Summary

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

Syntax

#include "ltwrappr.h"

virtual L_VOID LAnnotationWindow::OnZoom(uZoomPercent)

Parameters

L_UINT 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:

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

Platforms

Win32, x64.

See Also

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 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.