Draws the specified three-dimensional shape into the target device context using the specified color, style, and size.
#include "l_bitmap.h"
L_LTEFX_API L_INT L_EfxDraw3dShape(hDC, uShape, pRect, crBack, hdcBack, prcBack, uBackStyle, crFill, uFillStyle, crBorder, uBorderStyle, uBorderWidth, crInnerHilite, crInnerShadow, uInnerStyle, uInnerWidth, crOuterHilite, crOuterShadow, uOuterStyle, uOuterWidth, nShadowX, nShadowY, crShadow, hRgn)
Handle to the target device context.
Shape type. For valid values, refer to Effect Shapes.
Pointer to the display destination rectangle.
COLORREF value that specifies the background color.
Handle to the source device context for background. Use this parameter and prcBack
to place an image from another device context into the background of the shape. To use a background image, the uFillStyle
parameter must not be EFX_FILLSTYLE_SOLID.
Pointer to the display background rectangle.
Background style. For valid values, refer to Effect Background Styles.
COLORREF value that specifies the foreground color.
Foreground style. The following are valid values:
Value | Meaning |
---|---|
EFX_FILLSTYLE_SOLID | Solid filling ◼ |
EFX_FILLSTYLE_TRANSPARENT | Transparent filling ◻ |
EFX_FILLSTYLE_HORIZONTAL | Horizontal lines ▤ |
EFX_FILLSTYLE_VERTICAL | Vertical lines ▥ |
EFX_FILLSTYLE_FDIAGONAL | Downward diagonal lines ▨ |
EFX_FILLSTYLE_BDIAGONAL | Upward diagonal lines ▧ |
EFX_FILLSTYLE_CROSS | Cross lines ▦ |
EFX_FILLSTYLE_DIAGCROSS | Diagonal cross lines ▩ |
COLORREF value that specifies the border color.
Border style. The following are valid values:
Value | Meaning |
---|---|
EFX_BORDERSTYLE_TRANSPARENT | Transparent |
EFX_BORDERSTYLE_SOLID | Solid line |
EFX_BORDERSTYLE_DASH | Dash line (valid only for 1-pixel lines) |
EFX_BORDERSTYLE_DOT | Dot line (valid only for 1-pixel lines) |
EFX_BORDERSTYLE_DASHDOT | Dash dot line (valid only for 1-pixel lines) |
EFX_BORDERSTYLE_DASHDOTDOT | Dash dot dot line (valid only for 1-pixel lines) |
Border width.
COLORREF value that specifies the inner band highlight color.
COLORREF value that specifies the inner band shadow color.
Inner band style. The following are valid values:
Value | Meaning |
---|---|
EFX_INNERSTYLE_NONE | None |
EFX_INNERSTYLE_INSET | Inner band inset |
EFX_INNERSTYLE_RAISED | Inner band raised |
The inner band is available only for squares and rectangles.
Inner band width.
COLORREF value that specifies the outer band highlight color.
COLORREF value that specifies the outer band shadow color.
Outer band style. The following are valid values:
Value | Meaning |
---|---|
EFX_OUTERSTYLE_NONE | None |
EFX_OUTERSTYLE_INSET | Outer band inset |
EFX_OUTERSTYLE_RAISED | Outer band raised |
Outer band width.
Horizontal position of the shadow.
Vertical position of the shadow.
COLORREF value that specifies the shadow color.
Handle to a Windows region that defines the shape. This parameter is used only if the uShape
parameter is EFX_SHAPE_REGION.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
Use hdcBack
and prcBack
to place an image from another device context into the background of the shape.
For general information, refer to Implementing Special Effects.
Win32, x64.
This example shows the minimum requirements for using L_EfxDraw3dShape.
L_INT EfxDraw3dShapeExample(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;
HDC hdcMem; // HDC for background image
HBITMAP hbmMem; // Bitmap for background image
RECT rcbm;
// 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);
}
// Create the gradient for the background of the 3D shape
rcbm.top = pDest->top;
rcbm.left = pDest->left;
rcbm.bottom = pDest->bottom;
rcbm.right = pDest->right;
OffsetRect(&rcbm, -pDest->left, -pDest->top);
hdcMem = CreateCompatibleDC(hdc);
hbmMem = CreateCompatibleBitmap(hdc, rcbm.right, rcbm.bottom);
hbmMem = (HBITMAP)SelectObject(hdcMem, hbmMem);
// Place a gradient in the background of the 3D shape
nRet = L_EfxGradientFillRect(hdcMem, &rcbm, EFX_GRADIENT_LINE_L_TO_R, RGB(255, 0, 0), RGB(0, 0, 255), 16);
if (nRet != SUCCESS)
return nRet;
// Draw the 3D shape
nRet = L_EfxDraw3dShape(hdc, // device context
EFX_SHAPE_STAR4, // star shape
pDest, // destination rectangle
RGB(0, 0, 255), // background color, blue
hdcMem, // use this to place an image in the background
&rcbm, // display background rectangle
EFX_BACKSTYLE_TRANSLUCENTTILEDIMAGE, // style flags for 3D shape
RGB(255, 0, 0), // foreground color, red
EFX_FILLSTYLE_TRANSPARENT, // foreground style
RGB(255, 0, 0), // border color, red
EFX_BORDERSTYLE_SOLID, // border style
5, // border width
RGB(255, 255, 255), // inner band highlight color, white
RGB(128, 128, 128), // inner band shadow color
EFX_INNERSTYLE_INSET, // inner band style
3, // inner band width
RGB(255, 0, 0), // outer band highlight color, RED
RGB(128, 128, 128), // outer band shadow color
EFX_OUTERSTYLE_INSET, // outer band style
3, // outer band width
2, // horizontal shadow position
2, // vertical shadow position
RGB(0, 0, 0), // shadow color, black
NULL); // no region handle
if (nRet != SUCCESS)
return nRet;
// Restore the old palette
if (hOurPalette)
SelectPalette(hdc, hSavedPalette, FALSE);
// Release the device context
ReleaseDC(hWnd, hdc);
DeleteObject(SelectObject(hdcMem, hbmMem));
DeleteDC(hdcMem);
return SUCCESS;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document