You are here: Start » AVL.NET » Function Reference » Image » Image Drawing » 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.CoordinateSystem2D? inLocationAlignment, AvlNet.Anchor2D inLocationAnchor, AvlNet.Pixel inColor, AvlNet.DrawingStyle inDrawingStyle, float inSize, float inOrientationAngle, AvlNet.Pixel? inBackgroundColor )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
ioImage | AvlNet.Image | ||||
![]() | inString | string | |||
![]() | inLocation | AvlNet.Location | |||
![]() | inLocationAlignment | AvlNet.CoordinateSystem2D? | |||
![]() | inLocationAnchor | AvlNet.Anchor2D | MiddleCenter | Default value: MiddleCenter. | |
![]() | inColor | AvlNet.Pixel | |||
![]() | inDrawingStyle | AvlNet.DrawingStyle | |||
![]() | inSize | float | 12.0f | Height of a character. Default value: 12.0f. | |
![]() | inOrientationAngle | float | 0.0f | Default value: 0.0f. | |
![]() | inBackgroundColor | AvlNet.Pixel? |
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.
![](../img/filters/DrawString.png)
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);