1C#2.0 print winform 打印窗体数据试试_reportusing System;
  2C#2.0 print winform 打印窗体数据试试_reportusing System.Collections.Generic;
  3C#2.0 print winform 打印窗体数据试试_reportusing System.ComponentModel;
  4C#2.0 print winform 打印窗体数据试试_reportusing System.Data;
  5C#2.0 print winform 打印窗体数据试试_reportusing System.Drawing;
  6C#2.0 print winform 打印窗体数据试试_reportusing System.Drawing.Drawing2D;
  7C#2.0 print winform 打印窗体数据试试_reportusing System.Text;
  8C#2.0 print winform 打印窗体数据试试_reportusing System.Windows.Forms;
  9C#2.0 print winform 打印窗体数据试试_reportusing System.Globalization; 
 10C#2.0 print winform 打印窗体数据试试_report
 11C#2.0 print winform 打印窗体数据试试_reportnamespace PrintTest
 12C#2.0 print winform 打印窗体数据试试_report_12C#2.0 print winform 打印窗体数据试试_winform_13C#2.0 print winform 打印窗体数据试试_image_14{
 13C#2.0 print winform 打印窗体数据试试_report_15C#2.0 print winform 打印窗体数据试试_测试_16    /**//// <summary>
 14C#2.0 print winform 打印窗体数据试试_winform_17    /// 打印报告测试 
 15C#2.0 print winform 打印窗体数据试试_winform_17    /// 2009-02-06 涂聚文 geovindu@163.com
 16C#2.0 print winform 打印窗体数据试试_image_19    /// </summary>
 17C#2.0 print winform 打印窗体数据试试_winform_17    public partial class PintUlrtDocument : Form
 18C#2.0 print winform 打印窗体数据试试_report_15C#2.0 print winform 打印窗体数据试试_测试_16    C#2.0 print winform 打印窗体数据试试_image_14{
 19C#2.0 print winform 打印窗体数据试试_report_15C#2.0 print winform 打印窗体数据试试_测试_16        /**//// <summary>
 20C#2.0 print winform 打印窗体数据试试_winform_17        /// 打印B超报告测试
 21C#2.0 print winform 打印窗体数据试试_image_19        /// </summary>
 22C#2.0 print winform 打印窗体数据试试_winform_17        public PintUlrtDocument()
 23C#2.0 print winform 打印窗体数据试试_report_15C#2.0 print winform 打印窗体数据试试_测试_16        C#2.0 print winform 打印窗体数据试试_image_14{
 24C#2.0 print winform 打印窗体数据试试_winform_17            InitializeComponent();
 25C#2.0 print winform 打印窗体数据试试_image_19        }
 26C#2.0 print winform 打印窗体数据试试_report_15C#2.0 print winform 打印窗体数据试试_测试_16        /**//// <summary>
 27C#2.0 print winform 打印窗体数据试试_winform_17        /// 打印
 28C#2.0 print winform 打印窗体数据试试_winform_17        /// </summary>
 29C#2.0 print winform 打印窗体数据试试_winform_17        /// <param name="sender"></param>
 30C#2.0 print winform 打印窗体数据试试_image_19        /// <param name="e"></param>
 31C#2.0 print winform 打印窗体数据试试_winform_17        private void btnPrint_Click(object sender, EventArgs e)
 32C#2.0 print winform 打印窗体数据试试_report_15C#2.0 print winform 打印窗体数据试试_测试_16        C#2.0 print winform 打印窗体数据试试_image_14{
 33C#2.0 print winform 打印窗体数据试试_winform_17
 34C#2.0 print winform 打印窗体数据试试_image_19        }
 35C#2.0 print winform 打印窗体数据试试_report_15C#2.0 print winform 打印窗体数据试试_测试_16        /**//// <summary>
 36C#2.0 print winform 打印窗体数据试试_winform_17        /// 打印浏览
 37C#2.0 print winform 打印窗体数据试试_winform_17        /// </summary>
 38C#2.0 print winform 打印窗体数据试试_winform_17        /// <param name="sender"></param>
 39C#2.0 print winform 打印窗体数据试试_image_19        /// <param name="e"></param>
 40C#2.0 print winform 打印窗体数据试试_winform_17        private void btnPrintView_Click(object sender, EventArgs e)
 41C#2.0 print winform 打印窗体数据试试_report_15C#2.0 print winform 打印窗体数据试试_测试_16        C#2.0 print winform 打印窗体数据试试_image_14{
 42C#2.0 print winform 打印窗体数据试试_winform_17            if (MessageBox.Show("是否打印预览?", "打印预览", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
 43C#2.0 print winform 打印窗体数据试试_report_15C#2.0 print winform 打印窗体数据试试_测试_16            C#2.0 print winform 打印窗体数据试试_image_14{
 44C#2.0 print winform 打印窗体数据试试_winform_17                this.printPreviewDialog1.Document = this.printDocument1;
 45C#2.0 print winform 打印窗体数据试试_winform_17                printPreviewDialog1.ShowDialog();
 46C#2.0 print winform 打印窗体数据试试_image_19            }
 47C#2.0 print winform 打印窗体数据试试_winform_17            else
 48C#2.0 print winform 打印窗体数据试试_report_15C#2.0 print winform 打印窗体数据试试_测试_16            C#2.0 print winform 打印窗体数据试试_image_14{
 49C#2.0 print winform 打印窗体数据试试_winform_17                this.printDocument1.Print();//直接打印
 50C#2.0 print winform 打印窗体数据试试_image_19            }
 51C#2.0 print winform 打印窗体数据试试_image_19        }
 52C#2.0 print winform 打印窗体数据试试_report_15C#2.0 print winform 打印窗体数据试试_测试_16        /**//// <summary>
 53C#2.0 print winform 打印窗体数据试试_winform_17        /// 打印设置
 54C#2.0 print winform 打印窗体数据试试_winform_17        /// </summary>
 55C#2.0 print winform 打印窗体数据试试_winform_17        /// <param name="sender"></param>
 56C#2.0 print winform 打印窗体数据试试_image_19        /// <param name="e"></param>
 57C#2.0 print winform 打印窗体数据试试_winform_17        private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
 58C#2.0 print winform 打印窗体数据试试_report_15C#2.0 print winform 打印窗体数据试试_测试_16        C#2.0 print winform 打印窗体数据试试_image_14{
 59C#2.0 print winform 打印窗体数据试试_winform_17            //字体设置
 60C#2.0 print winform 打印窗体数据试试_winform_17            //this.dateTimePicker1.Format=dateTimePicker1.CustomFormat;
 61C#2.0 print winform 打印窗体数据试试_winform_17            dateTimePicker1.CustomFormat = "yyyy-MM-dd";
 62C#2.0 print winform 打印窗体数据试试_winform_17            //System.DateTime currentTime = new System.DateTime(); 
 63C#2.0 print winform 打印窗体数据试试_winform_17
 64C#2.0 print winform 打印窗体数据试试_winform_17            DateTime date = DateTime.Now;
 65C#2.0 print winform 打印窗体数据试试_winform_17            String format = "u";
 66C#2.0 print winform 打印窗体数据试试_winform_17            string year=DateTime.Now.Year.ToString();
 67C#2.0 print winform 打印窗体数据试试_winform_17            string month=date.ToString(format).Substring(5,2);
 68C#2.0 print winform 打印窗体数据试试_winform_17            string day = date.ToString(format).Substring(8, 2);
 69C#2.0 print winform 打印窗体数据试试_winform_17
 70C#2.0 print winform 打印窗体数据试试_winform_17            Font tFont = new Font("宋体", 20, FontStyle.Bold);
 71C#2.0 print winform 打印窗体数据试试_winform_17            Font mFont = new Font("宋体", 15, FontStyle.Regular);
 72C#2.0 print winform 打印窗体数据试试_winform_17            Font bFont = new Font("宋体", 10, FontStyle.Regular);
 73C#2.0 print winform 打印窗体数据试试_winform_17            Font lFont = new Font("宋体", 10, FontStyle.Regular);
 74C#2.0 print winform 打印窗体数据试试_winform_17            e.Graphics.DrawString("缔友计算机信息技术有限公司", tFont, Brushes.Black, 180, 10);
 75C#2.0 print winform 打印窗体数据试试_winform_17            e.Graphics.DrawString("电脑超声诊断报告", mFont, Brushes.Black, 250, 40);
 76C#2.0 print winform 打印窗体数据试试_winform_17            e.Graphics.DrawString("超声号:", bFont, Brushes.Black, 20, 70);
 77C#2.0 print winform 打印窗体数据试试_winform_17            e.Graphics.DrawString(this.txtUrltID.Text.Trim(), bFont, Brushes.Black, 70, 70);
 78C#2.0 print winform 打印窗体数据试试_winform_17            e.Graphics.DrawString("检查医生:", bFont, Brushes.Black, 290, 70);
 79C#2.0 print winform 打印窗体数据试试_winform_17            e.Graphics.DrawString(this.combPhyName.Text.Trim(), bFont, Brushes.Black, 360, 70);
 80C#2.0 print winform 打印窗体数据试试_winform_17            e.Graphics.DrawString("检查部位:", bFont, Brushes.Black, 20,90);
 81C#2.0 print winform 打印窗体数据试试_winform_17            e.Graphics.DrawString(this.combCheckBody.Text.Trim(), bFont, Brushes.Black, 80, 90);
 82C#2.0 print winform 打印窗体数据试试_winform_17            //划直线
 83C#2.0 print winform 打印窗体数据试试_winform_17            Pen Lapiz = new Pen(Color.Black, 1);
 84C#2.0 print winform 打印窗体数据试试_winform_17            int PosY = e.MarginBounds.Top;
 85C#2.0 print winform 打印窗体数据试试_winform_17            int PosX = e.MarginBounds.Height;
 86C#2.0 print winform 打印窗体数据试试_winform_17            e.Graphics.DrawLine(Lapiz, 20, PosY+10, 810, PosY+10);
 87C#2.0 print winform 打印窗体数据试试_winform_17            
 88C#2.0 print winform 打印窗体数据试试_winform_17            e.Graphics.DrawString("图像特征:", bFont, Brushes.Black, 20, 120);
 89C#2.0 print winform 打印窗体数据试试_winform_17            e.Graphics.DrawString(this.txtPicImpress.Text.Trim(), bFont, Brushes.Black, 40, 140);
 90C#2.0 print winform 打印窗体数据试试_winform_17            e.Graphics.DrawString("身份证图像", bFont, Brushes.Black, 420, 120);
 91C#2.0 print winform 打印窗体数据试试_winform_17            e.Graphics.DrawImage(this.pictureBox2.Image, 450, 140, 350, 350);
 92C#2.0 print winform 打印窗体数据试试_winform_17            //
 93C#2.0 print winform 打印窗体数据试试_winform_17            e.Graphics.DrawString("超声提示:", bFont, Brushes.Black, 20, 300);
 94C#2.0 print winform 打印窗体数据试试_winform_17            e.Graphics.DrawString(this.combMessage.Text, bFont, Brushes.Black, 40, 320);
 95C#2.0 print winform 打印窗体数据试试_winform_17            string emty = "      ";
 96C#2.0 print winform 打印窗体数据试试_winform_17            e.Graphics.DrawString("医师签字:", bFont, Brushes.Black, 600, 500);
 97C#2.0 print winform 打印窗体数据试试_winform_17            e.Graphics.DrawString("___________________", bFont, Brushes.Black,680, 500);
 98C#2.0 print winform 打印窗体数据试试_winform_17            e.Graphics.DrawString(this.combPhyName.Text+emty, lFont, Brushes.Black, 680, 500);
 99C#2.0 print winform 打印窗体数据试试_winform_17            e.Graphics.DrawString("报告日期:", bFont, Brushes.Black, 600, 520);
100C#2.0 print winform 打印窗体数据试试_winform_17            e.Graphics.DrawString(year, bFont, Brushes.Black, 680, 520);
101C#2.0 print winform 打印窗体数据试试_winform_17            e.Graphics.DrawString("年", bFont, Brushes.Black, 720, 520);
102C#2.0 print winform 打印窗体数据试试_winform_17            e.Graphics.DrawString(month, bFont, Brushes.Black, 740, 520);
103C#2.0 print winform 打印窗体数据试试_winform_17            e.Graphics.DrawString("月", bFont, Brushes.Black, 760, 520);
104C#2.0 print winform 打印窗体数据试试_winform_17            e.Graphics.DrawString(day, bFont, Brushes.Black, 790, 520);
105C#2.0 print winform 打印窗体数据试试_winform_17            e.Graphics.DrawString("日", bFont, Brushes.Black, 810, 520);
106C#2.0 print winform 打印窗体数据试试_winform_17            
107C#2.0 print winform 打印窗体数据试试_winform_17            
108C#2.0 print winform 打印窗体数据试试_winform_17            //Graphics G;
109C#2.0 print winform 打印窗体数据试试_winform_17            //G = this.CreateGraphics();
110C#2.0 print winform 打印窗体数据试试_winform_17            //G.DrawLine(new Pen(Color.Red, 10), 50, 10, 50, 100);
111C#2.0 print winform 打印窗体数据试试_winform_17
112C#2.0 print winform 打印窗体数据试试_winform_17            //Graphics grfx = e.Graphics;
113C#2.0 print winform 打印窗体数据试试_winform_17            //grfx.DrawString(Text, Font, Brushes.Black, 0, 0);
114C#2.0 print winform 打印窗体数据试试_winform_17            //SizeF sizef = grfx.MeasureString(Text, Font);
115C#2.0 print winform 打印窗体数据试试_winform_17            //grfx.DrawLine(Pens.Black, sizef.ToPointF(), grfx.VisibleClipBounds.Size.ToPointF());
116C#2.0 print winform 打印窗体数据试试_winform_17            //grfx.DrawLine(Pens.Red, sizef.ToPointF(),grfx.VisibleClipBounds.Size.ToPointF());
117C#2.0 print winform 打印窗体数据试试_winform_17
118C#2.0 print winform 打印窗体数据试试_测试_16C#2.0 print winform 打印窗体数据试试_report_15            画斜线#region 画斜线
119C#2.0 print winform 打印窗体数据试试_winform_17            //Graphics graphics = e.Graphics;
120C#2.0 print winform 打印窗体数据试试_winform_17            //Pen pen = new Pen(Color.Red, 5);
121C#2.0 print winform 打印窗体数据试试_report_15C#2.0 print winform 打印窗体数据试试_测试_16            /**///// Opaque aqua
122C#2.0 print winform 打印窗体数据试试_winform_17            //SolidBrush brush = new SolidBrush(Color.FromArgb(255, 180, 255, 255));
123C#2.0 print winform 打印窗体数据试试_report_15C#2.0 print winform 打印窗体数据试试_测试_16            /**///// Create a plus-shaped region by forming the union of two rectangles.
124C#2.0 print winform 打印窗体数据试试_winform_17            //Region region = new Region(new Rectangle(50, 0, 50, 150));
125C#2.0 print winform 打印窗体数据试试_winform_17            //region.Union(new Rectangle(0, 50, 150, 50));
126C#2.0 print winform 打印窗体数据试试_winform_17            //graphics.FillRegion(brush, region);
127C#2.0 print winform 打印窗体数据试试_report_15C#2.0 print winform 打印窗体数据试试_测试_16            /**///// Set the clipping region.
128C#2.0 print winform 打印窗体数据试试_winform_17            //graphics.SetClip(region, CombineMode.Replace);
129C#2.0 print winform 打印窗体数据试试_winform_17
130C#2.0 print winform 打印窗体数据试试_report_15C#2.0 print winform 打印窗体数据试试_测试_16            /**///// Draw two clipped lines.
131C#2.0 print winform 打印窗体数据试试_winform_17            //graphics.DrawLine(pen, 0, 30, 150, 160);
132C#2.0 print winform 打印窗体数据试试_winform_17            //graphics.DrawLine(pen, 40, 20, 190, 150);
133C#2.0 print winform 打印窗体数据试试_winform_17
134C#2.0 print winform 打印窗体数据试试_image_19            #endregion
135C#2.0 print winform 打印窗体数据试试_winform_17
136C#2.0 print winform 打印窗体数据试试_测试_16C#2.0 print winform 打印窗体数据试试_report_15            画多边形#region 画多边形
137C#2.0 print winform 打印窗体数据试试_winform_17            //GraphicsPath path = new GraphicsPath();
138C#2.0 print winform 打印窗体数据试试_winform_17            //path.StartFigure();
139C#2.0 print winform 打印窗体数据试试_winform_17            //path.AddArc(175, 50, 50, 50, 0, -180);
140C#2.0 print winform 打印窗体数据试试_winform_17            //path.AddLine(100, 0, 250, 20);
141C#2.0 print winform 打印窗体数据试试_winform_17            //path.StartFigure();
142C#2.0 print winform 打印窗体数据试试_winform_17            //path.AddLine(50, 20, 5, 90);
143C#2.0 print winform 打印窗体数据试试_report_15C#2.0 print winform 打印窗体数据试试_测试_16            /**/////path.AddCurve(points, 3);
144C#2.0 print winform 打印窗体数据试试_winform_17            //path.AddLine(50, 150, 150, 180);
145C#2.0 print winform 打印窗体数据试试_winform_17            //path.CloseFigure();
146C#2.0 print winform 打印窗体数据试试_winform_17            //e.Graphics.DrawPath(new Pen(Color.Black), path);
147C#2.0 print winform 打印窗体数据试试_winform_17
148C#2.0 print winform 打印窗体数据试试_winform_17            // e.Graphics.DrawString("Report Title", new Font("Arial", 16), Brushes.Black, 95, 70);
149C#2.0 print winform 打印窗体数据试试_image_19            #endregion 
150C#2.0 print winform 打印窗体数据试试_测试_16C#2.0 print winform 打印窗体数据试试_report_15            页底部#region 页底部
151C#2.0 print winform 打印窗体数据试试_winform_17            // Draw footer
152C#2.0 print winform 打印窗体数据试试_winform_17    //e.Graphics.DrawImage(pictureBox2.Image,  95, e.PageBounds.Height - 87);
153C#2.0 print winform 打印窗体数据试试_winform_17    //Font drawFont =new Font("Arial",8);
154C#2.0 print winform 打印窗体数据试试_winform_17
155C#2.0 print winform 打印窗体数据试试_winform_17    //e.Graphics.DrawString("Report Title", drawFont, Brushes.Gray, 190, e.PageBounds.Height - 90);
156C#2.0 print winform 打印窗体数据试试_winform_17    //e.Graphics.DrawString("Printed", drawFont, Brushes.Gray, 190, e.PageBounds.Height - 76);
157C#2.0 print winform 打印窗体数据试试_winform_17    //e.Graphics.DrawString("Printed By", drawFont, Brushes.Gray, 190, e.PageBounds.Height - 62);
158C#2.0 print winform 打印窗体数据试试_winform_17
159C#2.0 print winform 打印窗体数据试试_report_15C#2.0 print winform 打印窗体数据试试_测试_16    /**///// Draw some grid lines to add structure to the footer information
160C#2.0 print winform 打印窗体数据试试_winform_17    //e.Graphics.DrawLine(Pens.Gray, 246, e.PageBounds.Height - 90, 246, e.PageBounds.Height - 48);
161C#2.0 print winform 打印窗体数据试试_winform_17    //e.Graphics.DrawLine(Pens.Gray, 188, e.PageBounds.Height - 75, 550, e.PageBounds.Height - 75);
162C#2.0 print winform 打印窗体数据试试_winform_17    //e.Graphics.DrawLine(Pens.Gray, 188, e.PageBounds.Height - 61, 550, e.PageBounds.Height - 61);
163C#2.0 print winform 打印窗体数据试试_winform_17
164C#2.0 print winform 打印窗体数据试试_winform_17    //e.Graphics.DrawString("Report", drawFont, Brushes.Black, 250, e.PageBounds.Height - 90);
165C#2.0 print winform 打印窗体数据试试_winform_17    //e.Graphics.DrawString(DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString(), drawFont, Brushes.Black, 250, e.PageBounds.Height - 76);
166C#2.0 print winform 打印窗体数据试试_winform_17    //e.Graphics.DrawString("Andrew", drawFont, Brushes.Black, 250, e.PageBounds.Height - 62);
167C#2.0 print winform 打印窗体数据试试_image_19            #endregion 
168C#2.0 print winform 打印窗体数据试试_image_19}
169C#2.0 print winform 打印窗体数据试试_report_15C#2.0 print winform 打印窗体数据试试_测试_16        /**//// <summary>
170C#2.0 print winform 打印窗体数据试试_winform_17        /// 创建图片
171C#2.0 print winform 打印窗体数据试试_winform_17        /// </summary>
172C#2.0 print winform 打印窗体数据试试_image_19        /// <param name="e"></param>
173C#2.0 print winform 打印窗体数据试试_winform_17        public void DrawImageRectF(PaintEventArgs e)
174C#2.0 print winform 打印窗体数据试试_report_15C#2.0 print winform 打印窗体数据试试_测试_16        C#2.0 print winform 打印窗体数据试试_image_14{
175C#2.0 print winform 打印窗体数据试试_winform_17
176C#2.0 print winform 打印窗体数据试试_winform_17            // Create image.
177C#2.0 print winform 打印窗体数据试试_winform_17            Image newImage = Image.FromFile(Application.StartupPath + "//Customers Pics//CustPic.bmp");
178C#2.0 print winform 打印窗体数据试试_winform_17
179C#2.0 print winform 打印窗体数据试试_winform_17            // Create rectangle for displaying image.
180C#2.0 print winform 打印窗体数据试试_winform_17            RectangleF rect = new RectangleF(100.0F, 100.0F, 450.0F, 150.0F);
181C#2.0 print winform 打印窗体数据试试_winform_17
182C#2.0 print winform 打印窗体数据试试_winform_17            // Draw image to screen.
183C#2.0 print winform 打印窗体数据试试_winform_17            e.Graphics.DrawImage(newImage, rect);
184C#2.0 print winform 打印窗体数据试试_image_19        }
185C#2.0 print winform 打印窗体数据试试_report_15C#2.0 print winform 打印窗体数据试试_测试_16        /**//// <summary>
186C#2.0 print winform 打印窗体数据试试_winform_17        /// 加载窗体
187C#2.0 print winform 打印窗体数据试试_winform_17        /// </summary>
188C#2.0 print winform 打印窗体数据试试_winform_17        /// <param name="sender"></param>
189C#2.0 print winform 打印窗体数据试试_image_19        /// <param name="e"></param>
190C#2.0 print winform 打印窗体数据试试_winform_17        private void PintUlrtDocument_Load(object sender, EventArgs e)
191C#2.0 print winform 打印窗体数据试试_report_15C#2.0 print winform 打印窗体数据试试_测试_16        C#2.0 print winform 打印窗体数据试试_image_14{
192C#2.0 print winform 打印窗体数据试试_winform_17            pictureBox2.SizeMode = PictureBoxSizeMode.StretchImage;
193C#2.0 print winform 打印窗体数据试试_winform_17            pictureBox2.Image = Image.FromFile(Application.StartupPath + "//Customers Pics//CustPic.bmp");
194C#2.0 print winform 打印窗体数据试试_image_19        }
195C#2.0 print winform 打印窗体数据试试_report_15C#2.0 print winform 打印窗体数据试试_测试_16        /**//// <summary>
196C#2.0 print winform 打印窗体数据试试_winform_17        /// 画直线
197C#2.0 print winform 打印窗体数据试试_winform_17        /// </summary>
198C#2.0 print winform 打印窗体数据试试_image_19        /// <param name="e"></param>
199C#2.0 print winform 打印窗体数据试试_winform_17        public void DrawLinePoint(PaintEventArgs e)
200C#2.0 print winform 打印窗体数据试试_report_15C#2.0 print winform 打印窗体数据试试_测试_16        C#2.0 print winform 打印窗体数据试试_image_14{
201C#2.0 print winform 打印窗体数据试试_winform_17            //   Create   pen.  
202C#2.0 print winform 打印窗体数据试试_winform_17            Pen blackPen = new Pen(Color.Black, 3);
203C#2.0 print winform 打印窗体数据试试_winform_17            //   Create   points   that   define   line.  
204C#2.0 print winform 打印窗体数据试试_winform_17            Point point1 = new Point(100, 100);
205C#2.0 print winform 打印窗体数据试试_winform_17            Point point2 = new Point(500, 100);
206C#2.0 print winform 打印窗体数据试试_winform_17            //   Draw   line   to   screen.  
207C#2.0 print winform 打印窗体数据试试_winform_17            e.Graphics.DrawLine(blackPen, point1, point2);
208C#2.0 print winform 打印窗体数据试试_image_19        }   
209C#2.0 print winform 打印窗体数据试试_report_15C#2.0 print winform 打印窗体数据试试_测试_16        /**//// <summary>
210C#2.0 print winform 打印窗体数据试试_winform_17        /// 画直线
211C#2.0 print winform 打印窗体数据试试_winform_17        /// </summary>
212C#2.0 print winform 打印窗体数据试试_image_19        /// <param name="e"></param>
213C#2.0 print winform 打印窗体数据试试_winform_17        protected override void OnPaint(PaintEventArgs e)
214C#2.0 print winform 打印窗体数据试试_report_15C#2.0 print winform 打印窗体数据试试_测试_16        C#2.0 print winform 打印窗体数据试试_image_14{
215C#2.0 print winform 打印窗体数据试试_winform_17            Pen myPen = new Pen(Color.Red); 
216C#2.0 print winform 打印窗体数据试试_winform_17            Graphics g = e.Graphics;
217C#2.0 print winform 打印窗体数据试试_winform_17            myPen.Width = 5;
218C#2.0 print winform 打印窗体数据试试_winform_17            g.DrawLine(myPen, 1, 1, 100, 100);
219C#2.0 print winform 打印窗体数据试试_winform_17
220C#2.0 print winform 打印窗体数据试试_image_19        }
221C#2.0 print winform 打印窗体数据试试_winform_17
222C#2.0 print winform 打印窗体数据试试_测试_16C#2.0 print winform 打印窗体数据试试_report_15        身份证#region  身份证
223C#2.0 print winform 打印窗体数据试试_winform_17        //private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
224C#2.0 print winform 打印窗体数据试试_winform_17        //{
225C#2.0 print winform 打印窗体数据试试_winform_17        //    OracleLob myLob = null; //定义Oracle的Lob对象  
226C#2.0 print winform 打印窗体数据试试_winform_17        //    MemoryStream myMs = null; //定义内存流  
227C#2.0 print winform 打印窗体数据试试_winform_17        //    OracleDataReader myRead = null; //定义数据读取器  
228C#2.0 print winform 打印窗体数据试试_winform_17        //    myCmd.CommandText = "select   *   from   mytab";
229C#2.0 print winform 打印窗体数据试试_winform_17        //    myCmd.Connection = myConn;
230C#2.0 print winform 打印窗体数据试试_winform_17        //    int js = 0; //循环计数器  
231C#2.0 print winform 打印窗体数据试试_winform_17        //    int bound = 350; //表格边界  
232C#2.0 print winform 打印窗体数据试试_winform_17        //    int i = 0;
233C#2.0 print winform 打印窗体数据试试_winform_17
234C#2.0 print winform 打印窗体数据试试_winform_17        //    try
235C#2.0 print winform 打印窗体数据试试_winform_17        //    {
236C#2.0 print winform 打印窗体数据试试_winform_17        //        if (myConn.State == ConnectionState.Closed)
237C#2.0 print winform 打印窗体数据试试_winform_17        //        {
238C#2.0 print winform 打印窗体数据试试_winform_17        //            myConn.Open();
239C#2.0 print winform 打印窗体数据试试_winform_17        //        }
240C#2.0 print winform 打印窗体数据试试_winform_17
241C#2.0 print winform 打印窗体数据试试_winform_17        //        myRead = myCmd.ExecuteReader();
242C#2.0 print winform 打印窗体数据试试_winform_17
243C#2.0 print winform 打印窗体数据试试_winform_17        //        while (myRead.Read())
244C#2.0 print winform 打印窗体数据试试_winform_17        //        {
245C#2.0 print winform 打印窗体数据试试_winform_17        //            if (myRead.GetOracleLob(1) != null)
246C#2.0 print winform 打印窗体数据试试_winform_17        //            {
247C#2.0 print winform 打印窗体数据试试_winform_17        //                myLob = myRead.GetOracleLob(1);
248C#2.0 print winform 打印窗体数据试试_winform_17        //            }
249C#2.0 print winform 打印窗体数据试试_winform_17
250C#2.0 print winform 打印窗体数据试试_winform_17        //            this.asBarcode1.Typ = BarcodeType.Code39; //设置条型码为code39格式  
251C#2.0 print winform 打印窗体数据试试_winform_17        //            this.asBarcode1.Text = myRead["ID"].ToString();         //设置输出条型码  
252C#2.0 print winform 打印窗体数据试试_winform_17        //            myMs = new MemoryStream((byte[])myLob.Value);
253C#2.0 print winform 打印窗体数据试试_winform_17        //            photo = new Bitmap(myMs);
254C#2.0 print winform 打印窗体数据试试_winform_17
255C#2.0 print winform 打印窗体数据试试_winform_17        //            Graphics myDc = e.Graphics;
256C#2.0 print winform 打印窗体数据试试_winform_17        //            myDc.DrawRectangle(new Pen(Brushes.Black), 100, 50 + bound * js, 600, 260);
257C#2.0 print winform 打印窗体数据试试_winform_17        //            myDc.DrawLine(new Pen(Brushes.Black), new Point(100, 80 + bound * js), new Point(700, 80 + bound * js));
258C#2.0 print winform 打印窗体数据试试_winform_17        //            myDc.DrawString("姓名", new Font("宋体", 12), Brushes.Black, new Point(110, 57 + bound * js));
259C#2.0 print winform 打印窗体数据试试_winform_17        //            myDc.DrawLine(new Pen(Brushes.Black), new Point(155, 50 + bound * js), new Point(155, 80 + bound * js));
260C#2.0 print winform 打印窗体数据试试_winform_17        //            myDc.DrawString(myRead["name"].ToString(), new Font("宋体", 12), Brushes.Black, new Point(165, 57 + bound * js));
261C#2.0 print winform 打印窗体数据试试_winform_17        //            myDc.DrawLine(new Pen(Brushes.Black), new Point(240, 50 + bound * js), new Point(240, 80 + bound * js));
262C#2.0 print winform 打印窗体数据试试_winform_17        //            myDc.DrawString("性别", new Font("宋体", 12), Brushes.Black, new Point(250, 57 + bound * js));
263C#2.0 print winform 打印窗体数据试试_winform_17        //            myDc.DrawLine(new Pen(Brushes.Black), new Point(295, 50 + bound * js), new Point(295, 80 + bound * js));
264C#2.0 print winform 打印窗体数据试试_winform_17        //            myDc.DrawString(myRead["sex"].ToString(), new Font("宋体", 12), Brushes.Black, new Point(305, 57 + bound * js));
265C#2.0 print winform 打印窗体数据试试_winform_17        //            myDc.DrawLine(new Pen(Brushes.Black), new Point(335, 50 + bound * js), new Point(335, 80 + bound * js));
266C#2.0 print winform 打印窗体数据试试_winform_17        //            myDc.DrawString("身份证号码", new Font("宋体", 12), Brushes.Black, new Point(345, 57 + bound * js));
267C#2.0 print winform 打印窗体数据试试_winform_17        //            myDc.DrawLine(new Pen(Brushes.Black), new Point(445, 50 + bound * js), new Point(445, 80 + bound * js));
268C#2.0 print winform 打印窗体数据试试_winform_17        //            myDc.DrawString(myRead["id"].ToString(), new Font("宋体", 12), Brushes.Black, new Point(455, 57 + bound * js));
269C#2.0 print winform 打印窗体数据试试_winform_17        //            this.asBarcode1.Left = 110;
270C#2.0 print winform 打印窗体数据试试_winform_17        //            this.asBarcode1.Top = 90 + bound * js;
271C#2.0 print winform 打印窗体数据试试_winform_17        //            this.asBarcode1.DrawBarcode(myDc);
272C#2.0 print winform 打印窗体数据试试_winform_17        //            myDc.DrawLine(new Pen(Brushes.Black), new Point(100, 130 + bound * js), new Point(700, 130 + bound * js));
273C#2.0 print winform 打印窗体数据试试_winform_17        //            myDc.DrawLine(new Pen(Brushes.Black), new Point(240, 130 + bound * js), new Point(240, 310 + bound * js));
274C#2.0 print winform 打印窗体数据试试_winform_17        //            myDc.DrawImage((Image)photo, new Point[]{  
275C#2.0 print winform 打印窗体数据试试_winform_17        //new   Point(110,140   +   bound   *   js),  
276C#2.0 print winform 打印窗体数据试试_winform_17        //new   Point(230,140   +   bound   *   js),  
277C#2.0 print winform 打印窗体数据试试_winform_17        //new   Point(110,280   +   bound   *   js)  
278C#2.0 print winform 打印窗体数据试试_winform_17        //});
279C#2.0 print winform 打印窗体数据试试_winform_17        //            myDc.DrawString("一代证像片", new Font("宋体", 12), Brushes.Black, new Point(125, 285 + bound * js));
280C#2.0 print winform 打印窗体数据试试_winform_17        //            myDc.DrawLine(new Pen(Brushes.Black), new Point(380, 130 + bound * js), new Point(380, 310 + bound * js));
281C#2.0 print winform 打印窗体数据试试_winform_17        //            // myDc.DrawImage((Image)photo,new   Point[]{  
282C#2.0 print winform 打印窗体数据试试_winform_17        //            //       new   Point(250,140   +   bound   *   js), //二代证像片  
283C#2.0 print winform 打印窗体数据试试_winform_17        //            //       new   Point(370,140   +   bound   *   js),  
284C#2.0 print winform 打印窗体数据试试_winform_17        //            //       new   Point(250,280   +   bound   *   js)  
285C#2.0 print winform 打印窗体数据试试_winform_17        //            //       });  
286C#2.0 print winform 打印窗体数据试试_winform_17        //            myDc.DrawString("二代证像片", new Font("宋体", 12), Brushes.Black, new Point(265, 285 + bound * js));
287C#2.0 print winform 打印窗体数据试试_winform_17
288C#2.0 print winform 打印窗体数据试试_winform_17        //            js++;
289C#2.0 print winform 打印窗体数据试试_winform_17
290C#2.0 print winform 打印窗体数据试试_winform_17        //            e.HasMorePages = true;  
291C#2.0 print winform 打印窗体数据试试_winform_17        //        }
292C#2.0 print winform 打印窗体数据试试_winform_17        //    }
293C#2.0 print winform 打印窗体数据试试_winform_17        //    catch (Exception err)
294C#2.0 print winform 打印窗体数据试试_winform_17        //    {
295C#2.0 print winform 打印窗体数据试试_winform_17        //        MessageBox.Show(err.Message);
296C#2.0 print winform 打印窗体数据试试_winform_17        //    }
297C#2.0 print winform 打印窗体数据试试_winform_17        //    finally
298C#2.0 print winform 打印窗体数据试试_winform_17        //    {
299C#2.0 print winform 打印窗体数据试试_winform_17        //        myMs.Close();
300C#2.0 print winform 打印窗体数据试试_winform_17        //        myRead.Close();
301C#2.0 print winform 打印窗体数据试试_winform_17
302C#2.0 print winform 打印窗体数据试试_winform_17        //        if (myConn.State == ConnectionState.Open)
303C#2.0 print winform 打印窗体数据试试_winform_17        //        {
304C#2.0 print winform 打印窗体数据试试_winform_17        //            myConn.Close();
305C#2.0 print winform 打印窗体数据试试_winform_17        //        }
306C#2.0 print winform 打印窗体数据试试_winform_17        //    }
307C#2.0 print winform 打印窗体数据试试_winform_17        //} 
308C#2.0 print winform 打印窗体数据试试_image_19        #endregion 
309C#2.0 print winform 打印窗体数据试试_report_15C#2.0 print winform 打印窗体数据试试_测试_16        /**//// <summary>
310C#2.0 print winform 打印窗体数据试试_winform_17        /// 
311C#2.0 print winform 打印窗体数据试试_winform_17        /// </summary>
312C#2.0 print winform 打印窗体数据试试_image_19        /// <param name="args"></param>
313C#2.0 print winform 打印窗体数据试试_winform_17        //public   static   void   date(string[]   args)    
314C#2.0 print winform 打印窗体数据试试_winform_17        //{
315C#2.0 print winform 打印窗体数据试试_winform_17        //        DateTime   dt   =   DateTime.Now;
316C#2.0 print winform 打印窗体数据试试_winform_17        //        String[]   format   =   {
317C#2.0 print winform 打印窗体数据试试_winform_17        //                "d ",   "D ",
318C#2.0 print winform 打印窗体数据试试_winform_17        //                "f ",   "F ",
319C#2.0 print winform 打印窗体数据试试_winform_17        //                "g ",   "G ",
320C#2.0 print winform 打印窗体数据试试_winform_17        //                "m ",
321C#2.0 print winform 打印窗体数据试试_winform_17        //                "r ",
322C#2.0 print winform 打印窗体数据试试_winform_17        //                "s ",
323C#2.0 print winform 打印窗体数据试试_winform_17        //                "t ",   "T ",
324C#2.0 print winform 打印窗体数据试试_winform_17        //                "u ",   "U ",
325C#2.0 print winform 打印窗体数据试试_winform_17        //                "y ",
326C#2.0 print winform 打印窗体数据试试_winform_17        //                "dddd,   MMMM   dd   yyyy ",
327C#2.0 print winform 打印窗体数据试试_winform_17        //                //"ddd,   MMM   d   / " '/ "yy ",
328C#2.0 print winform 打印窗体数据试试_winform_17        //                "dddd,   MMMM   dd ",
329C#2.0 print winform 打印窗体数据试试_winform_17        //                "M/yy ",
330C#2.0 print winform 打印窗体数据试试_winform_17        //                "dd-MM-yy ",
331C#2.0 print winform 打印窗体数据试试_winform_17        //        };
332C#2.0 print winform 打印窗体数据试试_winform_17        //        String   date;
333C#2.0 print winform 打印窗体数据试试_winform_17        //        for   (int   i   =   0;   i   <   format.Length;   i++)   {
334C#2.0 print winform 打印窗体数据试试_winform_17        //                date   =   dt.ToString(format[i],   DateTimeFormatInfo.InvariantInfo);
335C#2.0 print winform 打印窗体数据试试_winform_17        //                Console.WriteLine(String.Concat(format[i],   "   : "   ,   date));
336C#2.0 print winform 打印窗体数据试试_winform_17        //        } 
337C#2.0 print winform 打印窗体数据试试_winform_17        //}
338C#2.0 print winform 打印窗体数据试试_winform_17
339C#2.0 print winform 打印窗体数据试试_image_19    }
340C#2.0 print winform 打印窗体数据试试_winform_384