Share via


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

3/2/2014

Displays the bitmap with the specified alignment and width.

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

Syntax

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

Parameters

  • fileName
    File name or URL of the bitmap file. Various file formats can be supported, such as BMP, GIF, or JPEG.
  • width
    Width of the bitmap to be displayed. See values below.
  • alignmentX
    Horizontal placement of the bitmap to be displayed. For possible values, see Remarks.
  • alignmentY
    Vertical placement of the bitmap to be displayed. For possible values, see Remarks.

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 active window’s viewport.

If the values specified for the alignmentX and alignmentY are the values that are 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 does not exactly occupy a multiple of rows and columns, then the unused 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 they are required) exceeds the distance from alignmentX to the window bottom, then the bitmap is not 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 as follows:

  • 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 nonzero, then the bitmap will be transformed by stretching or compressing the bitmap in such a way that its width is the specified width and the aspect ratio is unchanged. The advantages of this option are as follows:

  • It sizes the bitmap to fit many Line Display devices; and

  • It maintains the bitmap’s aspect ratio.

The disadvantages of this option are as follows:

  • Reduced performance than untransformed data; and

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

DisplayBitmap may cause a PosControlException to be thrown with one of the following ErrorCodes:

Value

Meaning

Illegal

One of the following errors occurred:

The Line Display device does not 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; or

The window size does not match its viewport size.

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