L_SetMagGlassPaintOptions

Summary

Sets the Magnifying Glass paint options.

Syntax

#include "l_bitmap.h"

L_LTDIS_API L_INT L_SetMagGlassPaintOptions(hWnd, pMagGlassPaintOptions)

Parameters

L_HWND hWnd

Handle of the window to which the magnifying glass is attached.

pMAGGLASSPAINTOPTIONS pMagGlassPaintOptions

Pointer to a structure that contains the new magnifying glass paint options to set.

Returns

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

Comments

The function is used to set the magnifying glass paint options (Intensity, Contrast and Gamma). Those paint options will be used when the magnifying glass paints the zoomed area, so you will see this area with some extra contrast or intensity.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

This example starts the Magnifying Glass then calls L_SetMagGlassPaintOptions function to set the Magnifying Glass paint options.

L_INT SetMagGlassPaintOptionsExample(L_HWND hWnd, pBITMAPHANDLE pBitmap, L_RECT * prcView) 
{ 
   L_INT                nRet; 
   L_TCHAR              szMsg[256] = TEXT(""); 
   MAGGLASSPAINTOPTIONS MagGlassPntOptions; 
   MAGGLASSOPTIONS      MagGlassOpt; 
 
   // Starting the Magnifying Glass 
   memset(&MagGlassOpt, 0, sizeof(MAGGLASSOPTIONS)); 
   MagGlassOpt.uStructSize = sizeof(MAGGLASSOPTIONS); 
   MagGlassOpt.nWidth = 100; 
   MagGlassOpt.nHeight = 100; 
   MagGlassOpt.nZoom = 400; 
   MagGlassOpt.clrPen = RGB(255, 0, 0); 
   MagGlassOpt.hMagCursor = NULL; 
   MagGlassOpt.clrBack = RGB(128, 128, 128); 
   MagGlassOpt.bEllipse = FALSE; 
   MagGlassOpt.nBorderSize = 1; 
   MagGlassOpt.b3D = TRUE; 
   MagGlassOpt.uPaintFlags = 0; 
   MagGlassOpt.pMask = NULL; 
   MagGlassOpt.uMaskCount = 0; 
   MagGlassOpt.nCrosshair = CROSSHAIR_FINE; 
   MagGlassOpt.bIgnoreRgn = TRUE; 
   MagGlassOpt.bCenter = TRUE; 
 
   nRet = L_StartMagGlass(hWnd, pBitmap, prcView, &MagGlassOpt, NULL, NULL); 
   if (nRet != SUCCESS) 
   { 
      wsprintf(szMsg, TEXT("Error Starting the Magnifying Glass, Error: %d"), nRet); 
      _tprintf(_T("%s"), szMsg); 
      return nRet; 
   } 
 
   // Setting the Magnifying Glass Paint contrast, gamma and intensity 
   MagGlassPntOptions.uStructSize = sizeof(MAGGLASSPAINTOPTIONS); 
   MagGlassPntOptions.nContrast = 100; 
   MagGlassPntOptions.nGamma = 100; 
   MagGlassPntOptions.nIntensity = 100; 
 
   nRet = L_SetMagGlassPaintOptions(hWnd, &MagGlassPntOptions); 
   if (nRet != SUCCESS) 
   { 
      wsprintf(szMsg, TEXT("Error Setting the Magnifying Glass painting options, Error: %d"), nRet); 
      _tprintf(_T("%s"), szMsg); 
   } 
 
   return nRet; 
} 

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