L_SetMagGlassPaintOptions

#include "l_bitmap.h"

L_LTDIS_API L_INT L_SetMagGlassPaintOptions(hWnd, pMagGlassPaintOptions)

L_HWND hWnd;

/* handle to a window */

pMAGGLASSPAINTOPTIONS pMagGlassPaintOptions;

/* pointer to a structure */

Sets the Magnifying Glass paint options.

Parameter

Description

hWnd

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

pMagGlassPaintOptions

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

Returns

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

LTDIS

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, Mobile.

See Also

Functions:

L_StartMagGlass, L_StartMagGlass, L_StopMagGlass, L_CreateZoomView, L_GetZoomViewProps, L_UpdateZoomView, L_DestroyZoomView, L_GetZoomViewsCount, L_WindowHasZoomView, ZOOMVIEWPROPS

Topics:

Using the Magnifying Glass

 

Raster Image Functions: Displaying Images

 

Using the Zoom View

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,
                                                    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); 
      MessageBox(hWnd, szMsg, TEXT("Error"), MB_ICONEXCLAMATION | MB_OK); 
      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); 
      MessageBox(hWnd, szMsg, TEXT("Error"), MB_ICONEXCLAMATION | MB_OK); 
      return nRet;
   }
   return SUCCESS;
}