L_AnnSelectPoint

#include "l_bitmap.h"

L_LTANN_API L_INT L_AnnSelectPoint(hObject, pPoint)

Selects the annotation object at the specified point, relative to the window. If objects overlap, this function selects the front object.

Parameters

HANNOBJECT hObject

Handle to the annotation object.

LPPOINT pPoint

Pointer to the Windows POINT structure. Coordinates are relative to the associated window's client area.

Returns

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

Comments

Selecting an object sets its selected property to TRUE.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

This example selects an object at a particular point in the window, changes the
background color of selected object, and updates the display.

L_INT AnnSelectPointExample(HWND         hWnd, 
                                          HANNOBJECT   hContainer)/* Container annotation object */ 
{ 
   L_INT nRet; 
   RECT  rClientArea;      /* Client area of the current window */ 
   POINT SelectionPoint;   /* Point in the client area */ 
   HDC   hWindowDC;        /* Device context of the current window */ 
   RECT  rAnnBounds;       /* Bounding rectangle when displaying the note */ 
 
   /* Get the device context of the current window */ 
   hWindowDC = GetDC (hWnd); 
 
   /* Get the client area of the current window */ 
   GetClientRect(hWnd,&rClientArea); 
 
   /* Select an object in the top left part of the window */ 
   SelectionPoint.y = rClientArea.bottom / 4; 
   SelectionPoint.x = rClientArea.right / 4; 
   nRet = L_AnnSelectPoint(hContainer, &SelectionPoint); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   /* Set the background color of the selected object */ 
   nRet = L_AnnSetBackColor(hContainer, RGB(255,0,0), ANNFLAG_SELECTED|ANNFLAG_RECURSE); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   /* Get the bounding rectangle of the selected object */ 
   nRet = L_AnnGetSelectRect(hContainer, &rAnnBounds); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   /* Get the window's device context */ 
   hWindowDC = GetDC (hWnd); 
 
   /* Display the change */ 
   nRet = L_AnnDraw(hWindowDC, &rAnnBounds, hContainer); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   /* Remove the queued paint message */ 
   ValidateRect(hWnd, &rAnnBounds); 
   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.