Class MarkingBuilderMeasurement
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
stringThis 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
TextBlockText 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
stringName of the font.
fontStyle
TrueTypeFontStyleStyle of the font.
content
stringText of the block.
fontHeight
doubleFont height in millimeters.
characterWidth
doubleWidth of the character in percent.
Returns
- BlockSize
The size of the block.