Share via


LineDisplayBase.DisplayBitmap Method (String, Int32, Int32, Int32)

2/27/2008

Displays the bitmap with the specified alignment and width.

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

Syntax

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

Parameters

  • fileName
    File name or URL of the bitmap file.
  • width
    Width of the bitmap to be displayed.
  • alignmentX
    Horizontal placement of the bitmap to be displayed.
  • alignmentY
    Vertical placement of the bitmap to be displayed.

Remarks

The width parameter has one of the following values:

Value

Meaning

DisplayBitmapAsIs

Display the bitmap with one bitmap pixel per dot.

Other values

Bitmap width expressed in number of pixels.

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, as specified by the CursorColumn property setting.

DisplayBitmapCenter

Align the bitmap in the horizontal center of the current character position, as specified by the CursorColumn property setting.

DisplayBitmapRight

Align the bitmap’s right edge with the rightmost pixel of the current character position, as specified by the CursorColumn property setting.

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, as specified by the CursorRow property setting.

DisplayBitmapCenter

Align the bitmap in the vertical center of the current character position, as specified by the CursorRow property setting.

DisplayBitmapBottom

Align the bitmap’s bottom edge with the bottommost pixel of the current character position, as specified by the CursorRow property setting.

Other values

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

The application calls DisplayBitmap to display a bitmap on the line display device. The bitmap is displayed within the current window’s viewport.

If the values specified for the alignmentX and alignmentY are the values defined by the DisplayBitmap constants, then the bitmap is displayed in relation to the character positions specified by the CursorColumn and CursorRow properties. In addition, if the CursorUpdate property is set to TRUE, then CursorColumn and CursorRow are updated to point to the first character position following the bitmap.

If the bitmap doesn’t exactly occupy a multiple of rows and columns, then the unoccupied pixels of those character positions that are partially occupied are displayed with the background color. In other words, the service object will fill all character positions partially or completely occupied by the bitmap with the background color before drawing the bitmap.

Bitmap display has the following restrictions:

  • Bitmap display is only legal when in Immediate mode;

  • The window size must match the window’s viewport size;

  • The bitmap must be displayable within the window, after consideration of the function parameters. For example, if alignmentX specifies a pixel near the bottom of the window and the bitmap height (after bitmap transformation, if required) exceeds the distance from alignmentX to the window bottom, then the bitmap isn’t displayed.

The width parameter controls transformation of the bitmap. If width is DisplayBitmapAsIs, then no transformation is performed. The bitmap is displayed with one bitmap pixel per line display pixel. The advantages of this option are:

  • It provides the highest performance bitmap display; and

  • It works well for bitmaps tuned for a specific line display device’s aspect ratio between horizontal and vertical dots.

If width is non-zero, then the bitmap will be transformed by stretching or compressing the bitmap such that its width is the specified width and the aspect ratio is unchanged. The advantages of this option are:

  • It sizes the bitmap to fit a variety of line display devices; and

  • It maintains the bitmap’s aspect ratio.

The disadvantages of this option are:

  • Lower performance than untransformed data; and

  • Some lines and images that are "smooth" in the original bitmap may show some "ratcheting."

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

DisplayBitmap may throw a PosControlException with the following ErrorCodes:

Value

Meaning

Illegal

One of the following errors occurred:The line display device doesn’t support bitmap display (the CapBitmap property is set to false;The width parameter is invalid or too big;The alignmentX/alignmentY parameters are invalid or too big;The window is not in Immediate Mode;The window size doesn’t match its viewport size;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.DisplayBitmap Method
LineDisplay.CapBitmap Property