打印二维码到小票上
用XtraReport的时候我会用,我用的是第三方的QRCode控件,所以只要设置PictureBox的数据源就可以了。
this.xrPictureBoxCode.Image = qrcode.QREncoder(strMeasureDocID);
qrcode.QREncoder()方法是用来生成二维码的。现在我用立象A2240E串口打印机,必须要用它的接口函数才行,其中有一个A_Get_Graphic()函数是可以打印图片,但是必须是来自计算机上的文件。我不想存到硬盘上在打印,能不能在缓存里直接打印呢?
下面是接口文档里A_Get_Graphic()函数的介绍。
*******************************************************************************
A_Get_Graphic()
===============================================================================
PURPOSE Download graph data from PC into the printer's RAM or Flash memory.
SYNTAX
VC:
int A_Get_Graphic(int x, int y, int mem_mode, char format, LPCTSTR
filename);
VB:
Declare Function A_Get_Graphic(ByVal x As Long, ByVal y As Long, ByVal
mem_mode As Long, ByVal format As Byte, ByVal filename As
String) As Long
PARAMETER
x; X coordinate.
y; Y coordinate.
mem_mode; Memory mode, 1 => RAM, 2 => Flash Memory
Notice: The flash writing lifespan is limited, unless
for special applications that require store
in Flash memory then recall in another procedure,
for general printing, it's strongly recommended
that all graphics being download into RAM.
format; Image file format.
+------+---------------------+---------+
|format|Image File Format |Direction|
+------+---------------------+---------+
| B |8-bit BMP file format|flipped |
+------+---------------------+---------+
| b |8-bit BMP file format| |
+------+---------------------+---------+
| I |8-bit IMG file format|flipped |
+------+---------------------+---------+
| i |8-bit IMG file format| |
+------+---------------------+---------+
| P |8-bit PCX file format|flipped |
+------+---------------------+---------+
| p |8-bit PCX file format| |
+------+---------------------+---------+
filename; File name of graphic data with path.
The format is XXXXXXXX.XXX or X:\XXX\XXX.XXX
RETURN 0 -> OK.
Reference AW-Error.txt file.
EXAMPLE
VC:
A_Get_Graphic(275,50,1,'B',"bb.bmp");
VB:
Call A_Get_Graphic(275,50,1,66,"bb.bmp")
The 'B' ASCII code is 66.
REMARK The Get_Graphic function will store graphic object in RAM memory.
------解决方案--------------------
搜 Neodynamic 這個