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 windowHPALETTE hSavedPalette = NULL; // Temporary copy of the current system paletteHPALETTE hOurPalette = NULL; // The palette that we will use to paintL_INT nBitsPerPixel;HDC hdcMem; // HDC for background imageHBITMAP hbmMem; // Bitmap for background imageRECT rcbm;// Get the device contexthdc = GetDC(hWnd);// Check the device to see if we need a palettenBitsPerPixel = GetDeviceCaps(hdc, BITSPIXEL) * GetDeviceCaps(hdc, PLANES);if (nBitsPerPixel <= 8){hOurPalette = (HPALETTE)GetStockObject(DEFAULT_PALETTE);hSavedPalette = SelectPalette(hdc, hOurPalette, FALSE);// Realize our paletteRealizePalette(hdc);}// Create the gradient for the background of the 3D shapercbm.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 shapenRet = 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 shapenRet = L_EfxDraw3dShape(hdc, // device contextEFX_SHAPE_STAR4, // star shapepDest, // destination rectangleRGB(0, 0, 255), // background color, bluehdcMem, // use this to place an image in the background&rcbm, // display background rectangleEFX_BACKSTYLE_TRANSLUCENTTILEDIMAGE, // style flags for 3D shapeRGB(255, 0, 0), // foreground color, redEFX_FILLSTYLE_TRANSPARENT, // foreground styleRGB(255, 0, 0), // border color, redEFX_BORDERSTYLE_SOLID, // border style5, // border widthRGB(255, 255, 255), // inner band highlight color, whiteRGB(128, 128, 128), // inner band shadow colorEFX_INNERSTYLE_INSET, // inner band style3, // inner band widthRGB(255, 0, 0), // outer band highlight color, REDRGB(128, 128, 128), // outer band shadow colorEFX_OUTERSTYLE_INSET, // outer band style3, // outer band width2, // horizontal shadow position2, // vertical shadow positionRGB(0, 0, 0), // shadow color, blackNULL); // no region handleif (nRet != SUCCESS)return nRet;// Restore the old paletteif (hOurPalette)SelectPalette(hdc, hSavedPalette, FALSE);// Release the device contextReleaseDC(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
