LVectorBase::GetPalette

Summary

Returns the palette associated with the specified vector handle.

Syntax

#include "ltwrappr.h"

virtual HPALETTE LVectorBase::GetPalette(L_VOID)

Returns

Returns the handle to the logical palette

Comments

You can use this palette to allow proper drawing of vector image colors in a palletized system.

Required DLLs and Libraries

See Also

Functions

Topics

Example

L_INT LVectorBase__GetPaletteExample(HWND hWnd, LVectorBase &Vector) 
{ 
   L_INT       nRet; 
   HDC         hdc; 
   PAINTSTRUCT ps; 
   RECT        rect; 
   HPALETTE    hOldPalette = NULL, hPal; 
 
   hdc = BeginPaint (hWnd, &ps) ; 
 
   GetClientRect(hWnd, &rect); 
   nRet = Vector.SetViewport(&rect); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   if (Vector.IsAllocated()) 
   { 
      // Create the palette that we will use to paint  
      hPal = Vector.GetPalette(); 
 
      if( hPal ) 
      { 
         hOldPalette = ::SelectPalette( hdc, hPal, TRUE ); 
         ::RealizePalette( hdc ); 
      } 
 
      nRet = Vector.Paint(hdc, TRUE); 
      if(nRet != SUCCESS) 
         return nRet; 
 
      if (hOldPalette) 
      { 
         ::SelectPalette (hdc, hOldPalette, FALSE); 
         DeleteObject(hPal); 
      } 
   } 
   EndPaint (hWnd, &ps) ; 
 
   return SUCCESS; 
} 
Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Vector C++ Class Library Help

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.