L_StartZoomViewAnnEdit

"l_bitmap.h"

L_LTZMV_API L_INT L_StartZoomViewAnnEdit(hWnd, pZoomViewAnnEdit)

Puts the Zoom Views that are attached to the specified window into annotation edit mode.

Parameters

HWND hWnd

Handle to a window.

pZOOMVIEWANNEDIT pZoomViewAnnEdit

Pointer to a ZOOMVIEWANNEDIT structure that specifies the annotation edit options to set.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

This function is used together with L_StopZoomViewAnnEdit to toggle the annotation edit mode. For information on using a zoom view with annotations, see the documentation for L_CreateZoomView and ZOOMVIEWPROPS. Once you have properly set up a zoom view that is using annotations, call the L_StartZoomViewAnnEdit function to display any annotations in edit mode or design mode. In edit mode, annotations can be created, and existing annotations can be modified, or deleted. To end the annotation edit mode (or to display the annotations in run-mode), call the function L_StopZoomViewAnnEdit function.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

This sample shows how to toggle the annotation edit mode of a Zoom View from design mode to run mode.
It is part of the ZoomView demo that ships with the toolkit.

// WINDOWDATA is used to associate window data with each window that contains zoom view objects. 
// Each window will have a valid annotation hAutomation object, and a valid annotation hContainer object. 
// For details on creating the hAutomation object and the hContainer object, see the ZoomView demo 
typedef struct tagWINDOWDATA 
{ 
   L_INT nActiveZoomView; 
   HANNOBJECT hContainer; 
   HANNOBJECT hAutomation; 
 
   // Other window data... 
} WINDOWDATA, *LPWINDOWDATA ; 
 
HWND ghwndToolbar = NULL; 
L_INT gnAnnUserMode = ANNUSER_DESIGN; 
 
BOOL CALLBACK AnnEnumAnnUserModeProc(HWND hwnd, LPARAM lParam) 
{ 
   LPWINDOWDATA pData = (LPWINDOWDATA)(LONG_PTR)GetWindowLongPtr(hwnd,GWLP_USERDATA); 
   L_INT nAnnUserMode = (L_INT)lParam; 
   if (pData && pData->hContainer) 
   { 
      L_INT nRet = L_AnnSetUserMode(pData->hContainer, nAnnUserMode); 
      if (nRet == SUCCESS) 
      { 
         if (nAnnUserMode == ANNUSER_DESIGN) 
         { 
            ZOOMVIEWANNEDIT ZoomViewAnnEdit; 
            memset(&ZoomViewAnnEdit, 0, sizeof(ZoomViewAnnEdit)); 
            ZoomViewAnnEdit.uStructSize = sizeof(ZoomViewAnnEdit); 
            ZoomViewAnnEdit.hAnnAutomation = pData->hAutomation; 
            ZoomViewAnnEdit.hWndAnnToolbar = ghwndToolbar; 
            L_StartZoomViewAnnEdit(hwnd, &ZoomViewAnnEdit); 
         } 
         else 
         { 
            L_StopZoomViewAnnEdit(hwnd); 
         } 
      } 
   } 
   return TRUE; //Continues enumeration 
} 
 
// hwnd - handle to the parent window of the zoom view 
// bAnnotationEditMode  - true: change to annotation edit mode 
//                      - false: change to annotation run mode 
L_INT ChangeZoomViewAnnotationMode(HWND hwnd, L_BOOL bAnnotationEditMode) 
{ 
   if (bAnnotationEditMode) 
   { 
      if (gnAnnUserMode != ANNUSER_DESIGN) 
      { 
         if (!ghwndToolbar) 
         { 
            POINT ptToolbar = {0,0}; 
            L_AnnCreateToolBar(hwnd, &ptToolbar, 
               ANNTOOLALIGN_LEFT | ANNTOOLALIGN_TOP, FALSE, &ghwndToolbar, 0, NULL);  
         } 
         if (ghwndToolbar) 
            ShowWindow(ghwndToolbar,SW_NORMAL); 
         EnumChildWindows(GetParent(hwnd), AnnEnumAnnUserModeProc, ANNUSER_DESIGN); 
         gnAnnUserMode = ANNUSER_DESIGN; 
      } 
   } 
   else // annotation run mode 
   { 
      if (gnAnnUserMode != ANNUSER_RUN) 
      { 
         if (ghwndToolbar) 
            ShowWindow(ghwndToolbar,SW_HIDE); 
         EnumChildWindows(GetParent(hwnd), AnnEnumAnnUserModeProc, ANNUSER_RUN); 
         gnAnnUserMode = ANNUSER_RUN; 
      } 
   } 
   return SUCCESS; 
} 

Help Version 21.0.2023.2.15
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.