Draws three-dimensional text which is rotated by the amount specified into the target device context using the specified font, color, and style.
#include "l_bitmap.h"
L_LTEFX_API L_INT L_EfxDrawRotated3dText(hDC, pszText, pRect, nAngle, uFlags, nXDepth, nYDepth, crText, crShadow, crHilite, hFont, hdcFore)
Handle to the target device context.
Text string.
Pointer to the display destination rectangle.
Text angle, in tenths of degrees.
Text style. Use this parameter to control the style and justification of the three-dimensional text. For valid values, refer to Effect Text Style Flags and Effect Text Alignment Flags.
Horizontal shadow position.
Vertical shadow position.
COLORREF value that specifies the text color.
COLORREF value that specifies the shadow color.
COLORREF value that specifies the border color.
Handle to the selected font. The font must be TrueType in order to rotate.
Handle to the source device context for the foreground. Use this parameter to place an image (such as a gradient) on the surface of the three-dimensional text. Use NULL to paint the color specified in crText.
| Value | Meaning |
|---|---|
| SUCCESS | The function was successful. |
| < 1 | An error occurred. Refer to Return Codes. |
The font must be TrueType in order to rotate. The rotation point will be calculated from (X, 0).
Drop shadows are available only for the following uFlags values:
The crShadow color is used for three-dimensional effects for the following uFlags values:
The crHilite color is used only for the following uFlags values:
For general information, refer to Implementing Special Effects.
Windows 2000 / XP/Vista.
This example shows the minimum requirements for using L_EfxDrawRotated3dText.
L_INT EfxDrawRotated3dTextExample(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;HFONT hFont; // Font to use for the text, must be TrueTypeHDC hdcMem; // HDC for foreground imageHBITMAP hbmMem; // Bitmap for foreground imageRECT rcbm;// Get the device contexthdc = GetDC(hWnd);// Create the gradient for the foreground of the 3D textrcbm.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 foreground of the 3D textnRet = L_EfxGradientFillRect(hdcMem, &rcbm, EFX_GRADIENT_LINE_L_TO_R, RGB(255, 0, 0), RGB(0, 0, 255), 16);if (nRet != SUCCESS)return nRet;// Create the fonthFont = CreateFont(-MulDiv(32, GetDeviceCaps(hdc, LOGPIXELSY), 72),0, 0, 0,FW_BOLD, FALSE, FALSE, FALSE,DEFAULT_CHARSET, OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH,TEXT("Arial"));// 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);}// Draw the Rotated 3D textnRet = L_EfxDrawRotated3dText(hdc, // device contextTEXT("Rotated 3D Text - LEADTOOLS"),pDest, // destination rectangle300, // rotate 30 degrees// style flags for 3D textEFX_TEXT_DROPSHADOW | EFX_TEXT_HCENTER | EFX_TEXT_VCENTER,2, // horizontal shadow position2, // vertical shadow positionRGB(0, 0, 255), // text color, blueRGB(0, 0, 0), // shadow color, blackRGB(255, 255, 255), // border color, whitehFont,hdcMem); // use this to put an image in the fontif (nRet != SUCCESS)return nRet;// Restore the old paletteif (hOurPalette)SelectPalette(hdc, hSavedPalette, FALSE);// Release the device contextReleaseDC(hWnd, hdc);DeleteObject(hFont);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
