Share via


LineDisplayBase.DefineGlyph Method (POS for .NET v1.14 SDK Documentation)

3/2/2014

Defines a glyph character.

Namespace: Microsoft.PointOfService.BaseServiceObjects
Assembly: Microsoft.PointOfService.ControlBase (in microsoft.pointofservice.controlbase.dll)

Syntax

'Declaration
Public Overrides Sub DefineGlyph ( _
    glyphCode As Integer, _
    glyph As Byte() _
)
public override void DefineGlyph (
    int glyphCode,
    byte[] glyph
)
public:
virtual void DefineGlyph (
    int glyphCode, 
    array<unsigned char>^ glyph
) override
public void DefineGlyph (
    int glyphCode, 
    byte[] glyph
)
public override function DefineGlyph (
    glyphCode : int, 
    glyph : byte[]
)

Parameters

  • glyphCode
    The character code to be defined.
  • glyph
    Byte array that defines the glyph.

Remarks

The glyph is defined as bits representing each pixel packed into bytes, using whole bytes to represent each row.

The minimum number of bytes are sent for each row, based on the value of the GlyphWidth property, and using 8 bits per byte. Bytes are sent left-to-right across each row; if more than one byte is required per row, the leftmost byte is sent first. The lowest-order bit within a byte represents the rightmost pixel. Bits that do not represent pixels are the highest-order bits, and their value is ignored. Rows are sent from the top down.

For example, a 10-pixel wide glyph would have the two leftmost pixels represented in bits 1 and 0 of the first byte, respectively. The remaining 8 pixels would be represented in the second byte.

Enough rows must be sent to define the entire character. Whether changing the definition of a glyph causes currently displayed characters to change, or the change appears only when the next glyph is drawn, is hardware-defined.

The LineDisplayBase class ensures that the line display device has been opened, claimed, and enabled.

DefineGlyph may throw a PosControlException with the following ErrorCodes:

Value

Meaning

Illegal

One of the following conditions has occurred:The CapCustomGlyph property is set to false, indicating that the device doesn’t support custom glyphs; The glyphCode parameter contains an unsupported character code for glyph definition; or The glyph parameter contains an incorrect number of bytes, (based on the GlyphWidth and GlyphHeight properties and 8 bits per byte).

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread-safe. Any instance members are not guaranteed to be thread-safe.

See Also

Reference

LineDisplayBase Class
LineDisplayBase Members
Microsoft.PointOfService.BaseServiceObjects Namespace
LineDisplay.CapCustomGlyph Property
LineDisplay.GlyphHeight Property
LineDisplay.GlyphWidth Property
LineDisplay.DefineGlyph Method