用delphi控制小票打印机打印图片
unit PosPrintBmp;
{***********************************************************************}
{ 单元名称:PosPrintBmp 小票打印机打印图片的类 }
{ }
{ 创建人:李红雷 }
{ 日期:2012.2 }
{ 修改人: }
{ 日期: }
{ 功能:GetDocument函数 得到图片的字节数组 }
{ 属性ByteLen 得到字节数组的长度 }
{ 用法: PosPrintBmp := TPosPrintBmp.Create(FPicName);
}
{ try }
{ PrintPic := PosPrintBmp.GetDocument;
}
{ gLen
:= PosPrintBmp.ByteLen; }
{ WritePrinter(hprinter, @PrintPic, gLen, N);
}
{ finally
}
{ PosPrintBmp.Free; }
{ end; }
{***********************************************************************}
interface
uses
Windows, SysUtils, Classes, Graphics,
jpeg;
const
Nul: Char = #0;
FormFeed: Char = #12;
Escape: Char = #27;
Newline: Char = #10;
GroupSeparator: Char = #29;
HorizontalTab: Char = #9;
CarriageReturn: Char = #13;
Cancel: Char = #24;
DataLinkEscape: C