Applies an effect when painting a bitmap region to a device context. This function works like L_PaintDCEffect, except that only the bitmap region is painted.
#include "l_bitmap.h"
L_LTEFX_API L_INT L_PaintRgnDCEffect (hDC, pBitmap, pSrc, pClipSrc, pDst, pClipDst, uROP3, uEffect)
Handle to a device context, such as a screen, to use as the display surface. The mapping mode of the device context must be MM_TEXT.
Pointer to the bitmap handle referencing the bitmap that has the region to paint.
Pointer to the Windows RECT structure that specifies the part of the bitmap to use as the display source.
The coordinates in the RECT structure are relative to the bitmap. You can pass NULL to use the default, which matches the bitmap.
Pointer to the Windows RECT structure that specifies the portion of the display source to paint. Generally, this is used for updating the display when part of the source bitmap has changed.
The coordinates in the RECT structure are relative to the bitmap. You can pass NULL to use the default, which matches the bitmap.
Pointer to the Windows RECT structure that determines how the source rectangle is scaled and how the image is positioned in the device context.
The coordinates in the RECT structure are relative to the device context. There is no default for this parameter. You must specify the RECT structure.
Pointer to the Windows RECT structure that specifies the portion of the display rectangle to paint. Generally, this is used for updating changes in the display surface, such as when a user moves another window, uncovering a part of the image that had been covered up.
The coordinates in the RECT structure are relative to the device context. You can pass NULL to use the default, which matches the device context. In most cases, however, you should use the rectangle returned by the Windows WM_PAINT message.
The Windows ROP code that determines how the destination rectangle is updated. This parameter takes the same codes as the Windows BitBlt function. For ordinary painting, use SRCCOPY.
The effect to apply when painting. For valid values, refer to Effects.
| Value | Meaning |
|---|---|
| SUCCESS | The function was successful. |
| < 1 | An error occurred. Refer to Return Codes. |
Multipass painting for the EFX_EFFECT_PUSH_CLASS is disabled.
Win32, x64.
For complete sample code, refer to the \Examples\ImageProcessing\C\Feature3 demo.
This example shows the minimum requirements for using L_PaintRgnDCEffect to paint the current region of a bitmap using the bitmap’s palette.
L_INT PaintRgnDCEffectExample(HWND hWnd, pBITMAPHANDLE LeadBitmap /* Bitmap handle for the image */){L_INT nRet;HDC hdc; // Device context for the current windowRECT rLeadDest; // Destination rectangle for paintingHPALETTE hSavedPalette = NULL; // Temporary copy of the current system paletteHPALETTE hOurPalette = NULL; // The palette that we will use to paint// Get the device contexthdc = GetDC(hWnd);// Set the destination rectangle to be the same as the bitmap.// Other painting rectangles can take defaults.SetRect(&rLeadDest, 0, 0, BITMAPWIDTH(LeadBitmap), BITMAPHEIGHT(LeadBitmap));// Create the palette that we will use to painthOurPalette = L_CreatePaintPalette(hdc, LeadBitmap);// Select our palette and save the old onehSavedPalette = SelectPalette(hdc, hOurPalette, FALSE);// Realize our paletteRealizePalette(hdc);// Paint the imagenRet = L_PaintRgnDCEffect(hdc, // Device contextLeadBitmap, // Bitmap handleNULL, // Default source rectangleNULL, // Default source clip area&rLeadDest, // Destination rectangleNULL, // Default destination clipping rectangleSRCCOPY, // ROP3 code for a normal paintEFFECT_SPIRAL_IN); // Spiral effectif (nRet != SUCCESS)return nRet;// Restore the old paletteSelectPalette(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
