Share via


LineDisplay.SetBitmap Method (Int32, String, Int32, Int32) (POS for .NET v1.14 SDK Documentation)

3/2/2014

Sets the bitmap number and placement.

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

Syntax

'Declaration
Public MustOverride Sub SetBitmap ( _
    bitmapNumber As Integer, _
    fileName As String, _
    alignmentX As Integer, _
    alignmentY As Integer _
)
public abstract void SetBitmap (
    int bitmapNumber,
    string fileName,
    int alignmentX,
    int alignmentY
)
public:
virtual void SetBitmap (
    int bitmapNumber, 
    String^ fileName, 
    int alignmentX, 
    int alignmentY
) abstract
public abstract void SetBitmap (
    int bitmapNumber, 
    String fileName, 
    int alignmentX, 
    int alignmentY
)
public abstract function SetBitmap (
    bitmapNumber : int, 
    fileName : String, 
    alignmentX : int, 
    alignmentY : int
)

Parameters

  • bitmapNumber
    The number to be assigned to this bitmap. Valid bitmap numbers are 1 through 100.
  • fileName
    The file name or URL of the bitmap file. Various file formats may be supported, such as BMP, GIF, or JPEG. If fileName is set to an empty string (""), then the bitmap is unset.
  • alignmentX
    The horizontal placement of the bitmap. For possible values, see Remarks.
  • alignmentY
    The vertical placement of the bitmap. For possible values, see Remarks.

Remarks

The alignmentX parameter has one of the following values:

Value

Meaning

DisplayBitmapLeft

Align the bitmap’s left edge with the leftmost pixel of the current character position.

DisplayBitmapCenter

Align the bitmap in the horizontal center of the current character position.

DisplayBitmapRight

Align the bitmap’s right edge with the rightmost pixel of the current character position.

Other values

Distance from the window’s leftmost pixel column to the left edge of the bitmap, expressed in number of pixels.

The alignmentY parameter has one of the following values:

Value

Meaning

DisplayBitmapTop

Align the bitmap’s top edge with the topmost pixel of the current character position.

DisplayBitmapCenter

Align the bitmap in the vertical center of the current character position.

DisplayBitmapBottom

Align the bitmap’s bottom edge with the bottommost pixel of the current character position.

Other values

Distance from the window’s topmost pixel row to the start of the bitmap, expressed in number of pixels.

Called to save information about a bitmap for later display. The bitmap may then be displayed by calling the DisplayText or DisplayTextAt methods with the display bitmap escape sequences in the display data. The display bitmap escape sequence will typically be included in a string for displaying advertisements, store logos, or icons. See the "Remarks" section of the DisplayBitmap method for restrictions on displaying the saved bitmap. If one or more restrictions are not fulfilled, then the bitmap is not displayed, and the method continues on with the next character of display data.

A service object may choose to cache the bitmap for later use to provide better performance. Regardless, the bitmap file and parameters are validated for correctness by this method.

The most frequently used bitmaps should be assigned a small bitmapNumber (close to 1), while occasionally used bitmaps should be assigned the larger bitmapNumbers. The service object will use this information to determine how best to store the bitmaps. It may download them to the device when it is possible, or cache them in service object memory, or remember the fileName and associated properties for use when it is displayed.

An application must make sure that the LineDisplay window metrics, such as viewport width and height, are set before it calls this method. A service object may perform transformations on the bitmap in preparation for later displaying based on the current values of these metrics.

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

Value

Meaning

Illegal

One of the following errors occurred:

  • The bitmapNumber parameter is invalid.

  • The Line Display device does not support bitmap display (the CapBitmap property is set to false.

  • The alignmentX/alignmentY parameters are invalid or too big.

NoExist

The specified fileName was not found.

Extended

ErrorCodeExtended = ExtendedErrorTooBig: The bitmap is either too wide to display without transformation, or it is too big to transform.

ErrorCodeExtended = ExtendedErrorBadFormat: The specified file is either not a bitmap file or it is in an unsupported format.

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