JVCL Help:TransparentBlt

From Project JEDI Wiki
Jump to navigationJump to search
JEDI Visual Component Library Help

Search in JVCL Help

 
Search in all projects
 

Summary

The TransparentBlt function performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source device context into a destination device context.

run\JvCaptionButton.pas


Pascal

 run\JvCaptionButton.pas
 functionTransparentBlt(hdcDest: HDC; nXOriginDest: Integer; nYOriginDest: Integer; nWidthDest: Integer; hHeightDest: Integer; hdcSrc: HDC; nXOriginSrc: Integer; nYOriginSrc: Integer; nWidthSrc: Integer; nHeightSrc: Integer; crTransparent: UINT): BOOL; stdcall;


Parameters

Parameters Description
hdcDest: HDC Handle to the destination device context.
nXOriginDest: Integer Specifies the x-coordinate, in logical units, of the upper-left corner of the destination rectangle.
nYOriginDest: Integer Specifies the y-coordinate, in logical units, of the upper-left corner of the destination rectangle.
nWidthDest: Integer Specifies the width, in logical units, of the destination rectangle.
hHeightDest: Integer Handle to the height, in logical units, of the destination rectangle.
hdcSrc: HDC Handle to the source device context.
nXOriginSrc: Integer Specifies the x-coordinate, in logical units, of the source rectangle.
nYOriginSrc: Integer Specifies the y-coordinate, in logical units, of the source rectangle.
nWidthSrc: Integer Specifies the width, in logical units, of the source rectangle.
nHeightSrc: Integer Specifies the height, in logical units, of the source rectangle.
crTransparent: UINT The RGB color in the source bitmap to treat as transparent.

run\JvCaptionButton.pas


Return Value

If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE.

run\JvCaptionButton.pas


Description

The TransparentBlt function works with compatible bitmaps (DDBs).
The TransparentBlt function supports all formats of source bitmaps. However, for 32 bpp bitmaps, it just copies the alpha value over. Use AlphaBlend to specify 32 bits-per-pixel bitmaps with transparency.
If the source and destination rectangles are not the same size, the source bitmap is stretched to match the destination rectangle. When the SetStretchBltMode function is used, the iStretchMode modes of BLACKONWHITE and WHITEONBLACK are converted to COLORONCOLOR for the TransparentBlt function.
The destination device context specifies the transformation type for the destination coordinates. The source device context specifies the transformation type for the source coordinates.
TransparentBlt does not mirror a bitmap if either the width or height, of either the source or destination, is negative.
Windows 95/98: TransparentBlt contains a memory leak that can exhaust system resources. To draw a transparent bitmap using BitBlt, see Knowledge Base article 79212.
Windows 98/Me, Windows 2000/XP: When used in a multiple monitor system, both hdcSrc and hdcDest must refer to the same device or the function will fail. To transfer data between DCs for different devices, convert the memory bitmap to a DIB by calling GetDIBits. To display the DIB to the second device, call SetDIBits or StretchDIBits.

run\JvCaptionButton.pas


About

Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page