This function is called whenever a zoom operation is requested on the bitmap window.
#include "ltwrappr.h"
virtual L_VOID LAnnotationWindow::OnZoom(uZoomPercent)
The zoom percent. The minimum value is 1.
None.
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.
Win32, x64.
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 Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document