You are here: Start » AVL.NET » AVL.DrawString(AvlNet.Image, string, AvlNet.Location, AvlNet.CoordinateSystem2D?, AvlNet.Anchor2D, AvlNet.Pixel, AvlNet.DrawingStyle, float, float, AvlNet.Pixel?)

AVL.DrawString(AvlNet.Image, string, AvlNet.Location, AvlNet.CoordinateSystem2D?, AvlNet.Anchor2D, AvlNet.Pixel, AvlNet.DrawingStyle, float, float, AvlNet.Pixel?)

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax


public static void DrawString(
	ref 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

ioImage
Type: AvlNet.Image
inString
Type: System.String
inLocation
Type: AvlNet.Location
inLocationAlignment
Type: System.Nullable<AvlNet.CoordinateSystem2D>
inLocationAnchor
Type: AvlNet.Anchor2D
inColor
Type: AvlNet.Pixel
inDrawingStyle
Type: AvlNet.DrawingStyle
inSize
Type: System.Single
inOrientationAngle
Type: System.Single
inBackgroundColor
Type: System.Nullable<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.

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(
                    ref 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);

See also