IC Imaging Control C++

OverlayBitmap::drawText Method

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

Get in touch with us


About The Imaging Source

Established in 1990, The Imaging Source is one of the leading manufacturers of industrial cameras, frame grabbers and video converters for production automation, quality assurance, logistics, medicine, science and security.

Our comprehensive range of cameras with USB 3.1, USB 3.0, USB 2.0, GigE interfaces and other innovative machine vision products are renowned for their high quality and ability to meet the performance requirements of demanding applications.

Automated Imaging Association ISO 9001:2015 certified

Contact us