コード例 #1
0
        private void continuePrint(Control c, int page, bool bTitle, Control panel)
        {
            ((Neusoft.FrameWork.EPRControl.emrPanel)panel).AutoScrollPosition = new Point(0, 0);

            Neusoft.FrameWork.WinForms.Classes.Print print = new Neusoft.FrameWork.WinForms.Classes.Print();
            //if (page == 0) page = 1;
            Common.Classes.Function.GetPageSize("EMR", ref print);
            //print.PrintDocument.DefaultPageSettings.PrinterSettings.FromPage = page;
            //print.PrintDocument.DefaultPageSettings.PrinterSettings.ToPage = 100;
            print.IsPrintInputBox  = !bTitle;
            print.IsPrintBackImage = false;
            print.IsDataAutoExtend = false;
            print.IsHaveGrid       = true;
            if (bTitle == false)
            {
                setOtherControlVisible(false, panel);
            }
            ((RichTextBox)c).Select(0, 0);
            ((RichTextBox)c).ScrollToCaret();

            Neusoft.FrameWork.WinForms.Classes.PrintControlCompare p = new Neusoft.FrameWork.WinForms.Classes.PrintControlCompare();
            p.SetEPRControl();
            print.SetControlCompare(p);

            print.PageLabel = ((Neusoft.FrameWork.EPRControl.emrPanel)panel).PageNumberControl;
            //print.DrawGraphic(this.pictureBox1.CreateGraphics(),panel);
            string file = Neusoft.FrameWork.WinForms.Classes.Function.CurrentPath + Neusoft.FrameWork.WinForms.Classes.Function.TempPath + "1.bmp";

            print.SaveAsFile(panel, file, page);
            System.IO.StreamReader reader = new System.IO.StreamReader(file);

            this.pictureBox1.Image = Image.FromStream(reader.BaseStream);
            reader.Close();
            if (bTitle == false)
            {
                setOtherControlVisible(true, panel);
            }
            c.Tag = this.StartLength;
        }