Table of Contents

Class MarkingBuilderMeasurement

Namespace
Loehnert.Lisrt.Laser.Keyence
Assembly
Loehnert.Lisrt.Laser.Keyence.dll

Represents a measurement for a logo.

public static class MarkingBuilderMeasurement
Inheritance
MarkingBuilderMeasurement
Inherited Members

Remarks

Uses the MarkingBuilder ActiveX component. This requires a MarkingBuilder installation. The MarkingBuilder ActiveX components (.ocx files) must be registered, see https://docs.lisrt.de/articles/Loehnert.Lisrt.Laser.Keyence/GettingStarted.html.

Methods

MeasureLogo(string)

Measures the size of the logo.

public static BlockSize MeasureLogo(string filename)

Parameters

filename string

This can be a relative file name to the MarkingBuilder logos directory, or a absolute file path. The maximum length is 100 chars.

Returns

BlockSize

The size of the logo.

Exceptions

ArgumentException

Thrown when filename is null or empty.

NotSupportedException

Thrown when filename does not end with '.mhl', '.mlg' or '.mwi'.

COMException

Thrown when the file does not exist.

MeasureTrueTypeFontTextBlock(TextBlock)

Measures the size of a TrueType Font text block.

public static BlockSize MeasureTrueTypeFontTextBlock(TextBlock textBlock)

Parameters

textBlock TextBlock

Text block to measure.

Returns

BlockSize

The size of the block.

MeasureTrueTypeFontTextBlock(string, TrueTypeFontStyle, string, double, double)

Measures the size of a TrueType Font text block.

public static BlockSize MeasureTrueTypeFontTextBlock(string fontName, TrueTypeFontStyle fontStyle, string content, double fontHeight, double characterWidth = 100)

Parameters

fontName string

Name of the font.

fontStyle TrueTypeFontStyle

Style of the font.

content string

Text of the block.

fontHeight double

Font height in millimeters.

characterWidth double

Width of the character in percent.

Returns

BlockSize

The size of the block.