LinePrinter.Bitmap Method

Prints a BMP file to a printer that supports graphics printing.

Syntax

[Visual Basic]
Public Function Bitmap( _
ByVal _dwStartCol As UInt32, _
ByVal _dwHeight As UInt32, _
ByVal _dwWidth As UInt32, _
ByVal _bsFilename As String _
) As Integer

 

[C#]
public int Bitmap(
uint _dwStartCol,
uint _dwHeight,
uint _dwWidth,
string _bsFilename );

Parameters

_dwStartCol
Starting column, in characters, for the start of the graphic. The width of a column is defined in the configuration file entry for the selected printer by the "GraphCharWidth" property and is defined in pixels.

_dwHeight
Desired height of graphic, in characters. Image is stretched to fit. The height of a character is defined in the configuration file entry for the selected printer by the "GraphCharHeight" property and is defined in pixels.

_dwWidth
Desired width of graphic, in characters. Image is stretched to fit. The width of a column is defined in the configuration file entry for the selected printer by the "GraphCharWidth" property and is defined in pixels.

_bsFilename
Name of BMP file to print. If no path is specified, LinePrinter will first look for the BMP in the directory the EXE is run from, then will look in the root directory.

Return Value

Positive return indicates that command was sent.

Negative value indicates that the method was called before Open, or after Close or Cancel.

Zero indicates that printer is incapable of this function based on a missing or null entry in the printer configuration file.

Remarks

Bitmap is stretched to fit the selected height and width. Automatic orphan control is built into function. Action is undefined if starting column + width is wider than printable width of printer.

The bitmap file specified should have a color depth of 1 bit per pixel or the results are undefined.

As of the Compact Framework 3.0 the Bitmap class can not create a 1 bit per pixel (1bpp) bitmap. If the bitmap is to be created dynamically, Honeywell suggests using a PInvoke into the native function CreateBitmap to create a 1bpp image. Then pass the handle returned by CreateBitmap to the Compact Framework managed method Bitmap.FromHbitmap.

More Information

LinePrinter Class