Example #1
0
        private void saveQRCodeButton_Click(object sender, EventArgs e)
        {
            // TODO: Add your control notification handler code here
            long   lResult;
            string strQRCodeLeft   = "QRCode Test Left Alignment";
            string strQRCodeCenter = "QRCode Test Center Alignment";
            string strQRCodeRight  = "QRCode Test Right Alignment";


            if (useprinterdriver)
            {
                m_strPrinter = pDriverNameTextBox.Text.ToString();
                lResult      = LKPrint.OpenPort(m_strPrinter, 1);
                if (lResult != 0)
                {
                    MessageBox.Show("OpenPrinter Failed", "Error", MessageBoxButtons.OK);
                    return;
                }
            }

            LKPrint.PrintStart();

            LKPrint.MakeQRCodeBitmap(strQRCodeLeft, 0, 3, 0, 0, -1, ".\\Left.bmp");
            LKPrint.MakeQRCodeBitmap(strQRCodeCenter, 0, 3, 0, 0, -1, ".\\Center.bmp");
            LKPrint.MakeQRCodeBitmap(strQRCodeRight, 0, 3, 0, 0, -1, ".\\Right.bmp");

            LKPrint.PrintBarCode("1234567890", 109, 40, 512, 1, 2); // POSPrinter
            LKPrint.PrintNormal("\x1b|fP");

            LKPrint.PrintStop();


            if (useprinterdriver)
            {
                lResult = LKPrint.ClosePort();
                if (lResult != 0)
                {
                    MessageBox.Show("ClosePrinter Failed!!!", "Error", MessageBoxButtons.OK);
                }
            }
        }