Share via


LineDisplayBase.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.BaseServiceObjects
Assembly: Microsoft.PointOfService.ControlBase (in microsoft.pointofservice.controlbase.dll)

Syntax

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

Parameters

  • bitmapNumber
    The number to be assigned to this bitmap.
  • fileName
    The file name or URL of the bitmap file.
  • alignmentX
    The horizontal placement of the bitmap.
  • alignmentY
    The vertical placement of the bitmap.

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 possible, or cache them in service object memory, or simply remember the fileName and associated properties for use when it is displayed.

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

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

SetBitmap may throw a PosControlException with the following ErrorCodes:

Value

Meaning

Illegal

One of the following errors occurred:The bitmapNumber parameter is invalid;The line display device doesn’t support bitmap display (the CapBitmap property is set to false;The alignmentX/alignmentY parameters are invalid or too big;The bitmap is either too wide to display without transformation, or it is too big to transform; orThe specified file is either not a bitmap file or it is in an unsupported format.

NoExist

The specified fileName was not found.

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.SetBitmap Method