LAnnAutomation::GetAutoHilightPen

#include "ltwrappr.h"

virtual COLORREF LAnnAutomation::GetAutoHilightPen()

Gets the color of the pen that is used for highlighting.

Returns

The color of the pen that is used for highlighting.

Comments

This function allows you to get the color of the pen that is used for highlighting and selecting.

Required DLLs and Libraries

LTANN

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:

LAnnotation::SetAutoBackColor, LAnnotation::GetAutoBackColor, LAnnotation::GetBackColor, LAnnotation::SetBackColor, LAnnAutomation::SetAutoCursor, LAnnotation::GetFillMode, LAnnotation::SetFillMode, LAnnotation::GetOptions, LAnnotation::SetOptions, Class Members

Topics:

Annotation Functions: Object Properties

 

Implementing Annotations

 

Implementing Custom Annotations

 

Automated User Interface for Annotations

 

Annotation Functions: Creating and Deleting Annotations

 

Types of Annotations

 

Annotation Functions: Creating Custom Annotations

 

Fixed Annotations

 

Minimizing Flicker With Double Buffering

 

Annotation Functions: Working with the Toolbar

 

Color Halftones and Halftone Images

 

Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images

Example

LAnnContainer  m_LeadAContainer;
LAnnToolBar    m_LeadAToolbar;
LAnnAutomation m_LeadAAutomation;
CBitmapWindow  m_LBitmap;
COLORREF m_crOldColor;


BOOL CAutomatedDlg::OnInitDialog()
{
   .
   .
   .
   .
   // TODO: Add extra initialization here
   LSettings::LoadLibraries(LT_ALL_LEADLIB);

   L_TCHAR * pszLicenseFile = L"Replace this with the path to the LEADTOOLS license file";
   L_TCHAR * pszDeveloperKey = L"Replace this with your developer key";
   LSettings::SetLicenseFile(pszLicenseFile, pszDeveloperKey);
   
   CWnd* pWnd = GetDlgItem(IDC_BITMAPWND);

   CRect rcRect;
   // Get the rectangle of the button
   pWnd->GetWindowRect(&rcRect);
   ScreenToClient(&rcRect);

   // Create the LBitmapWindow control, make it visible, and make it center the image
   HWND hWnd = m_LBitmap.CreateWnd(GetSafeHwnd(), 
                                   901, 
                                   WS_VISIBLE,
                                   rcRect.TopLeft().x,
                                   rcRect.TopLeft().y,
                                   rcRect.BottomRight().x,
                                   rcRect.BottomRight().y);

   int nRet = 0;
   RECT rcClientArea;
   ANNRECT rcContainerRect;

   
   nRet = m_LBitmap.Load (TEXT("c:\\1.bmp"));
   
   if(nRet == SUCCESS)
   {
      ::GetClientRect(hWnd,&rcClientArea);
      m_LBitmap.SetDstRect(&rcClientArea);

      rcContainerRect.left = 0;
      rcContainerRect.top = 0;
      rcContainerRect.right = rcClientArea.right-rcClientArea.left;
      rcContainerRect.bottom = rcClientArea.bottom-rcClientArea.top;

      m_LeadAContainer.Create (hWnd,&rcContainerRect,TRUE);
      m_LeadAContainer.SetOffsetX ((L_DOUBLE) 0, 0);
      m_LeadAContainer.SetOffsetY ((L_DOUBLE) 0, 0);
   
      m_LeadAAutomation.Create ();
 
      /* Assign the automation object to the container */
      m_LeadAAutomation.SetAutoContainer (&m_LeadAContainer);
      /* Enable the automation object */
      m_LeadAAutomation.SetActiveState (ANNACTIVE_ENABLED);
      /* Set design mode, which allows creation of annotations */
      m_LeadAContainer.SetUserMode ();
      /* Set the dots per inch for interpreting physical measurements */
      // m_LeadAContainer.SetDpiX (600, 0);
      m_LeadAContainer.SetDpiY (600, 0);

      /* Set the number of possible undo actions */
      m_LeadAAutomation.SetUndoDepth (3);
      /* Set the line tool as the initial annotation tool */
   
      m_LeadAToolbar.Create (GetSafeHwnd(), NULL, ANNTOOLALIGN_RIGHT | ANNTOOLALIGN_TOP, TRUE);
   
      m_LBitmap.SetContainer(&m_LeadAContainer);
      m_LBitmap.SetAutomation(&m_LeadAAutomation);
      m_LBitmap.SetToolBar(&m_LeadAToolbar);
   }
   
   return TRUE;  // return TRUE  unless you set the focus to a control
}


void CAutomatedDlg::OnAnnHilightPen() 
{
   UpdateData(TRUE);
m_crOldColor = m_LeadAAutomation.GetAutoHilightPen();
   m_LeadAAutomation.SetAutoHilightPen (m_bAnnHilightPen ? RGB(0xC0, 0xC0, 0xC0) : RGB(0xFF, 0xFF, 0xFF));
   UpdateData(FALSE);
}