L_EfxDrawFrame

#include "l_bitmap.h"

L_LTEFX_API L_INT L_EfxDrawFrame(hDC, pRect, uFlags, uFrameWidth, crFrame, uInnerWidth, crInner1, crInner2, uOuterWidth, crOuter1, crOuter2)

Draws a rectangular frame having the specified style, color, and border width into the target device context.

Parameters

HDC hDC

Handle to the target device context.

RECT *pRect

Pointer to the display destination rectangle.

L_UINT uFlags

Frame style. The following are valid values:

Value Meaning
EFX_FRAME_INNER_INSET [0x0000] Inner band inset
EFX_FRAME_INNER_RAISED [0x0001] Inner band raised
EFX_FRAME_OUTER_INSET [0x0000] Outer band inset
EFX_FRAME_OUTER_RAISED [0x0010] Outer band raised
EFX_FRAME_ADJUST_RECT [0x0100] Adjust dimensions of the destination rectangle

L_UINT uFrameWidth

Middle band width.

COLORREF crFrame

COLORREF value that specifies the middle band color.

L_UINT uInnerWidth

Inner band width.

COLORREF crInner1

COLORREF value that specifies the inner band shadow color.

COLORREF crInner2

COLORREF value that specifies the inner band highlight color.

L_UINT uOuterWidth

Outer band width.

COLORREF crOuter1

COLORREF value that specifies the outer band shadow color.

COLORREF crOuter2

COLORREF value that specifies the outer band highlight color.

Returns

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

Comments

For general information, refer to Implementing Special Effects.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

This example shows the minimum requirements for using the L_EfxDrawFrame function to draw a frame with a palette.

L_INT EfxDrawFrameExample(HWND     hWnd,RECT*    pDest) 
{ 
  L_INT nRet; 
  HDC       hdc;                    /* Device context for the current window */ 
  HPALETTE  hSavedPalette = NULL;   /* Temporary copy of the current system palette */ 
  HPALETTE  hOurPalette = NULL;     /* The palette that we will use to paint */ 
  L_INT     nBitsPerPixel; 
 
  /* Get the device context */ 
  hdc = GetDC (hWnd); 
  /* Check the device to see if we need a palette */ 
  nBitsPerPixel = GetDeviceCaps( hdc, BITSPIXEL ) * GetDeviceCaps ( hdc, PLANES ); 
  if ( nBitsPerPixel <=8 ) 
  { 
    hOurPalette = (HPALETTE)GetStockObject (DEFAULT_PALETTE); 
    hSavedPalette = SelectPalette (hdc, hOurPalette, FALSE); 
    /* Realize our palette */ 
    RealizePalette (hdc);  
  } 
  /* Draw the frame */ 
  nRet = L_EfxDrawFrame(hdc,                     /* Device context */ 
                 pDest,                   /* Destination rectangle */ 
                 EFX_FRAME_OUTER_RAISED,  /* outer band raised */ 
                 2,                       /* middle band width*/ 
                 RGB ( 255,0,0 ),         /* middle band color */ 
                 2,                       /* inner band width*/ 
                 RGB ( 100,100,100 ),     /* inner band shadow color */ 
                 RGB ( 0,0,0 ),           /* inner band highlight color */ 
                 2,                       /* outer band width*/ 
                 RGB ( 128,128,128 ),     /* inner band shadow color */ 
                 RGB ( 255,255,0 ) );     /* inner band highlight color */ 
  if(nRet != SUCCESS) 
     return nRet; 
 
  /* Restore the old palette */ 
  if  ( hOurPalette ) 
    SelectPalette (hdc, hSavedPalette, FALSE); 
  /* Release the device context */ 
  ReleaseDC(hWnd, hdc); 
   return SUCCESS; 
} 

Help Version 20.0.2019.9.22
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2019 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help