Skip to content

DrawBitmapOverFrame

method

Delphi
function DrawBitmapOverFrame (BitmapHandle: HBITMAP; Stretched: Boolean; LeftLocation: LongInt; TopLocation: LongInt; bmWidth: LongInt; bmHeight: LongInt; Transparent_Enabled: Boolean; UseTransparentColor: Boolean; Transparent_ColorValue: OLE_COLOR; AlphaBlend_Enabled: Boolean; AlphaBlend_Value: LongInt; ChromaKey: Boolean; ChromaKeyRGBColor: LongInt; ChromaKeyLeewayPercent: LongInt): Boolean;
C++Builder
bool __fastcall DrawBitmapOverFrame(Vcl::Graphics::TBitmap* Bitmap, bool Stretched, System::LongInt LeftLocation, System::LongInt TopLocation, System::LongInt bmWidth, System::LongInt bmHeight, bool Transparent_Enabled, bool UseTransparentColor, System::Uitypes::TColor Transparent_ColorValue, bool AlphaBlend_Enabled, System::LongInt AlphaBlend_Value, bool ChromaKey, System::LongInt ChromaKeyRGBColor, System::LongInt ChromaKeyLeewayPercent);
C#
public bool DrawBitmapOverFrame(IntPtr BitmapHandle, bool Stretched, int LeftLocation, int TopLocation, int bmWidth, int bmHeight, bool Transparent_Enabled, bool UseTransparentColor, int Transparent_ColorValue, bool AlphaBlend_Enabled, int AlphaBlend_Value, bool ChromaKey, int ChromaKeyRGBColor, int ChromaKeyLeewayPercent);
VB.NET
Public Function DrawBitmapOverFrame(BitmapHandle As IntPtr, Stretched As Boolean, LeftLocation As Integer, TopLocation As Integer, bmWidth As Integer, bmHeight As Integer, Transparent_Enabled As Boolean, UseTransparentColor As Boolean, Transparent_ColorValue As Integer, AlphaBlend_Enabled As Boolean, AlphaBlend_Value As Integer, ChromaKey As Boolean, ChromaKeyRGBColor As Integer, ChromaKeyLeewayPercent As Integer) As Boolean
C++/Qt
BOOL DrawBitmapOverFrame (HBITMAP BitmapHandle, BOOL Stretched, int LeftLocation, int TopLocation, int bmWidth, int bmHeight, BOOL Transparent_Enabled, BOOL UseTransparentColor, int Transparent_ColorValue, BOOL AlphaBlend_Enabled, int AlphaBlend_Value, BOOL ChromaKey, int ChromaKeyRGBColor, int ChromaKeyLeewayPercent);

Draws the bitmap passed as parameter over video frames.

Location: the bitmap is drawn at the LeftLocation, TopLocation position over the video frame (expressed in pixels).

Size: if the bmWidth or bmHeight parameter is different from the bitmap's width or height, the bitmap is stretched to bmWidth and bmHeight.

Transparency: if the Transparent parameter is true, the image background is not drawn. If the Transparent parameter is true and the UseTransparentColor parameter is true, the TransparentColorValue value is used for transparency.

Alpha blending: if the AlphaBlend parameter is true, a progressive bitmap transparency is applied, depending of the AlphaBlendValue, in a 0..255 range. It is not possible to perform alphablending when the Transparent parameter is true.

Important: if the bitmap color format is not 32 bits, it will be converted into a 32 bit format. In other words, for better performance pass a bitmap already in 32 bits color format.

The DrawBitmapOverFrame function can be called ONLY from the OnFrameOverlayUsingDC event. See the MainDemo project for sample code.