Share via


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

3/2/2014

Defines a glyph character.

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

Syntax

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

Parameters

  • glyphCode
    The character code to be defined.
  • glyph
    Data bytes that define the glyph.

Remarks

The glyph is defined as bits representing each pixel packed into bytes, by 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 whole 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.

DefineGlyph may cause a PosControlException to be thrown with the following ErrorCode.

Value

Meaning

Illegal

One of the following conditions has occurred:

  • The CapCustomGlyph property is set to false. This indicates that the device does not support custom glyphs.

  • The glyphCode parameter contains an unsupported character code for glyph definition.

  • 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

LineDisplay Class
LineDisplay Members
Microsoft.PointOfService Namespace
CapCustomGlyph
GlyphHeight
GlyphWidth