You are here: Start » AVL.NET » Function Reference » Image » Image Drawing » AVL.DrawString

AVL.DrawString

Draws a string on an image.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax

C++
C#
 
public static void DrawString
(
	AvlNet.Image ioImage,
	string inString,
	AvlNet.Location inLocation,
	AvlNet.Anchor2D inLocationAnchor,
	AvlNet.Pixel inColor,
	AvlNet.DrawingStyle inDrawingStyle,
	float inSize,
	float inOrientationAngle
)

Parameters

Name Type Range Default Description
ioImageAvlNet.Image
inStringstring
inLocationAvlNet.Location
inLocationAnchorAvlNet.Anchor2DMiddleCenterDefault value: MiddleCenter.
inColorAvlNet.Pixel
inDrawingStyleAvlNet.DrawingStyle
inSizefloat12.0fHeight of a character. Default value: 12.0f.
inOrientationAnglefloat0.0fDefault value: 0.0f.

Description

The operation draws a string on the ioImage aligning the inLocationAnchor location of the text at the inLocation of the ioImage. The height of the font is fixed and equals 16 pixels.

Usage of DrawString with various settings.

Examples

Following example draws appropriate message when no object is found in template matching-like inspection. It is a part of the bigger Basic Template Matching Example.

AVL.DrawString(
    inspectingImage,
    "No object found",
    new Location(inspectingImage.Width / 2, inspectingImage.Height / 2),
    Anchor2D.MiddleCenter,
    new Pixel(255.0f, 0.0f, 0.0f, 255.0f),
    style, 40.0f, 0.0f);

Function Overrides

See also