Draws a rectangle into the target device context, and then fills the rectangle with the specified pattern and color.
#include "l_bitmap.h"
L_LTEFX_API L_INT L_EfxPatternFillRect(hDC, pRect, uStyle, crBack, crFore)
Handle to the target device context.
Pointer to the display destination rectangle.
Filling style. The following are possible values. (Values cannot be combined.)
| Value | Meaning |
|---|---|
| EFX_PATTERN_SOLID | Solid ◼ |
| EFX_PATTERN_HORZ_LINE | Horizontal lines ▤ |
| EFX_PATTERN_VERT_LINE | Vertical lines ▥ |
| EFX_PATTERN_DOWNWARD_DIAG | Downward diagonal lines ▨ |
| EFX_PATTERN_UPWARD_DIAG | Upward diagonal lines ▧ |
| EFX_PATTERN_CROSS | Cross line ▦ |
| EFX_PATTERN_DIAG_CROSS | Diagonal cross lines ▩ |
| EFX_PATTERN_MAX | Diagonal cross lines ▩ |
COLORREF value that specifies the background color.
COLORREF value that specifies the foreground color.
| Value | Meaning |
|---|---|
| SUCCESS | The function was successful. |
| < 1 | An error occurred. Refer to Return Codes. |
For general information, refer to Implementing Special Effects.
Win32, x64.
This example shows the minimum requirements for using the L_EfxPatternFillRect function to draw and fill a rectangle with a pattern and color.
L_INT EfxPatternFillRectExample(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;// 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);}// Draw the pattern filled rectanglenRet = L_EfxPatternFillRect(hdc, // device contextpDest, // destination rectangleEFX_PATTERN_DIAG_CROSS, // diagonal cross patternRGB(0, 0, 0), // background color, blackRGB(0, 0, 255)); // foreground color, blueif (nRet != SUCCESS)return nRet;// Restore the old paletteif (hOurPalette)SelectPalette(hdc, hSavedPalette, FALSE);// Release the device contextReleaseDC(hWnd, hdc);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
