コード例 #1
0
        private void loadTemplateBtn_Click(object sender, EventArgs e)
        {
            String path   = @"D:\1.ezd";                         //下面第二个参数为true时可以随便写
            bool   loaded = MarkJcz.LoadEzdFile(ref path, true); //加载模板

            if (loaded)
            {
                //如果printing_text_label上有当前需要打印的内容,那么直接替换模板二维码中的内容
                if (printing_text_label.Text != null && printing_text_label.Text.Trim().Length != 0)
                {
                    MarkJcz.ChangeTextByName("no", printing_text_label.Text.Trim());//模板中的变量名字必须是no
                }

                MarkJcz.ShowPreviewBmp(printingQcode_pictureBox);
                path = path.Substring(path.LastIndexOf(@"\") + 1);
                currentTemplateName_label.Text = path;

                //加载完模板停止红光和标刻
                stopMark();
                stopRedLight();

                this.server_state_label.BeginInvoke(UpdateServerStateDelegate, "加载模板完成");
            }
            else
            {
                this.server_state_label.BeginInvoke(UpdateServerStateDelegate, "加载模板失败");
            }
        }
コード例 #2
0
        //更新显示正在打印的编码,同时更新二维码信息
        public void UpdateLabel(string txt)
        {
            this.printing_text_label.Text = txt;

            if (printing_text_label.Text != null && printing_text_label.Text.Trim().Length != 0)
            {
                MarkJcz.ChangeTextByName("no", printing_text_label.Text.Trim());//模板中的变量名字必须是no
                MarkJcz.ShowPreviewBmp(printingQcode_pictureBox);
            }
        }