Available in LEADTOOLS Imaging Pro, Vector, Document, and Medical Imaging toolkits. |
L_EfxDrawFrame
#include "l_bitmap.h"
L_LTEFX_API L_INT L_EfxDrawFrame(hDC, pRect, uFlags, uFrameWidth, crFrame, uInnerWidth, crInner1, crInner2, uOuterWidth, crOuter1, crOuter2)
HDC hDC; |
/* handle to the target device context */ |
RECT *pRect; |
/* pointer to the display rectangle */ |
L_UINT uFlags; |
/* frame style */ |
L_UINT uFrameWidth; |
/* middle band width */ |
COLORREF crFrame; |
/* middle band color */ |
L_UINT uInnerWidth; |
/* inner band width */ |
COLORREF crInner1; |
/* inner band shadow color */ |
COLORREF crInner2; |
/* inner band highlight color */ |
L_UINT uOuterWidth; |
/* outer band width */ |
COLORREF crOuter1; |
/* outer band shadow color */ |
COLORREF crOuter2; |
/* outer band highlight color */ |
Draws a rectangular frame having the specified style, color, and border width into the target device context.
Parameter |
Description |
|
hDC |
Handle to the target device context. |
|
pRect |
Pointer to the display destination rectangle. |
|
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 |
uFrameWidth |
Middle band width. |
|
crFrame |
COLORREF value that specifies the middle band color. |
|
uInnerWidth |
Inner band width. |
|
crInner1 |
COLORREF value that specifies the inner band shadow color. |
|
crInner2 |
COLORREF value that specifies the inner band highlight color. |
|
uOuterWidth |
Outer band width. |
|
crOuter1 |
COLORREF value that specifies the outer band shadow color. |
|
crOuter2 |
COLORREF value that specifies the outer band highlight color. |
Returns
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
LTEFX 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_EfxDraw3dShape, L_EfxDraw3dText, L_EfxDrawRotated3dText, L_EfxEffectBlt, L_EfxGradientFillRect, L_EfxPaintBitmap, L_EfxPaintTransition, L_EfxPatternFillRect, L_EfxTileRect |
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; }