OverlayBitmap::drawText Method

Draws a text on the live video.
Syntax:
bool drawText( COLORREF color, int iX, int iY, const char* szText );
bool drawText( COLORREF color, int iX, int iY, const std::string& szText );
bool drawText( COLORREF color, int iX, int iY, const std::wstring& szText );

Parameter Description
color

Specifies the color of the text to be drawn. The color can be specified with the RGB macro

iX

Specifies the column in pixel units where the text should start on the live video.

iY

Specifies the row in pixel units where the text should start on the live video.

szText

Points to a null terminated string that is to be drawn.

Return value:

true on success, false otherwise.

Remarks:

The used background color of the text is specified by a call to OverlayBitmap::setFontBKColor. The used background mode of the text is set by a call to OverlayBitmap::setFontTransparent.

Sample:

This example demonstrates how to enable the overlay bitmap and draw the text "Hello Word" in the upper left corner of the live video.

smart_ptr<DShowLib::OverlayBitmap> pOverlayBitmap;
pOverlayBitmap = m_Grabber.getOverlay( ePP_DEVICE );
// Make sure, the overlay for the text is enabled.
pOverlayBitmap->setEnable(true);
// Draw the text.
pOverlayBitmap->drawText( RGB(255,0,0),  0, 0, "Hello World" );

See also: OverlayBitmap, OverlayBitmap::setFontBKColor, OverlayBitmap::getFontBKColor, OverlayBitmap::setFontTransparent, OverlayBitmap::getFontTransparent

<< OverlayBitmap