zoukankan      html  css  js  c++  java
  • c# 画一个报告

    填充控件的grafics属性:

    private void printReportPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
            {
                printWidth = e.PageBounds.Width;
                sideMargin = printWidth / 12;
                topMargin = printWidth / 18;
                if (currentPrintReport == 0)
                {
                    if (langText[0] == "zh-CN")
                    {
                        if (printReportPage_C(currentPrintPage, e.Graphics, true))
                        {
                            e.HasMorePages = true;
                            currentPrintPage++;
                        }
                        else
                        {
                            currentPrintReport = 1;
                            currentPrintPage = 0;
                            if (multiLang)
                            {
                                e.HasMorePages = true;
                            }
                            else
                            {
                                e.HasMorePages = false;
                            }
                        }
                    }
                    else if (langText[0] == "EN")
                    {
                        //if (printReportPage_E(currentPrintPage, e.Graphics, true))
                        if (printReportPage_E(currentPrintPage, e.Graphics, false))
                        {
                            e.HasMorePages = true;
                            currentPrintPage++;
                        }
                        else
                        {
                            currentPrintReport = 1;
                            currentPrintPage = 0;
                            if (multiLang)
                            {
                                e.HasMorePages = true;
                            }
                            else
                            {
                                e.HasMorePages = false;
                            }
                        }
                    }
    
                }
                else if (currentPrintReport == 1)
                {
                    if (langText[1] == "zh-CN")
                    {
                        if (printReportPage_C(currentPrintPage, e.Graphics, false))
                        {
                            e.HasMorePages = true;
                            currentPrintPage++;
                        }
                        else
                        {
                            e.HasMorePages = false;
                        }
                    }
                    else if (langText[1] == "EN")
                    {
                        if (printReportPage_E(currentPrintPage, e.Graphics, false))
                        {
                            e.HasMorePages = true;
                            currentPrintPage++;
                        }
                        else
                        {
    
                            e.HasMorePages = false;
                        }
                    }
    
                }
                ////Graphics g = e.Graphics; //获得绘图对象
                //float leftMargin = e.MarginBounds.Left; //左边距
                //float topMargin = e.MarginBounds.Top; //上边距
                //float x1 = leftMargin;
                //float x2 = e.MarginBounds.Right;
                //float y = topMargin;
                //Rectangle rect1;
            }
    private Boolean printReportPage_C(int page, Graphics g, Boolean primary)//中文报告模板
            {
                // Graphics g = e.Graphics;
                g.InterpolationMode = InterpolationMode.HighQualityBicubic;
                int x1 = sideMargin;
                int x2 = printWidth - sideMargin;
                int y = topMargin;
                float right = printWidth;
                Rectangle rect1;
                Boolean ifPrintNum = true;
                Boolean ifPrintNum2 = true;
                ifConvert = checkBox_Fanti.Checked;
                switch (page)
                {
                    case 0: //首页
                        #region 首页
                        #region Log
                        y = topMargin;
                        y += 40;
                        g.DrawImage(Properties.Resources.logo, x1 + 15, y, 88, 64);
                        #endregion
    
                        #region 人体代谢热层像
                        y += 145;
                        rect1 = new Rectangle((int)x1, (int)y, (int)(x2 - x1), (int)(font_22r.GetHeight(g)));
                        g.DrawString(convertToTradition("人体代谢热层像", ifConvert), font_22r, myBrush, rect1, stringFormat);
                        y += 40;
                        rect1 = new Rectangle((int)x1, (int)y, (int)(x2 - x1), (int)(font_10r.GetHeight(g)));
                        g.DrawString("Thermal Metabolic Imaging , TMI", font_10r, myBrush, rect1, stringFormat);
                        y += 100;
                        rect1 = new Rectangle((int)x1, (int)y, (int)(x2 - x1), (int)(font_36b.GetHeight(g)));
                        //g.DrawString(convertToTradition("健康" + (checkBox_linchuang.Checked ? "检测" : "评估") + "报告", ifConvert), font_36b, myBrush, rect1, stringFormat);
                        g.DrawString(convertToTradition("健康评估报告", ifConvert), font_36b, myBrush, rect1, stringFormat);
                        y += 63;
                        rect1 = new Rectangle((int)x1, (int)y, (int)(x2 - x1), (int)(font_10r.GetHeight(g)));
                        g.DrawString("Health Evaluation Report in Medical Infrared", font_10r, myBrush, rect1, stringFormat);
                        y += 417;
                        y -= 60;
    
                        Point p1 = new Point((int)x1, (int)y);
                        Point p2 = new Point((int)x2, (int)y);
                        g.DrawLine(Pens.Gray, p1, p2);
    
                        #endregion
    
                        #region 姓名、采图站点、日期、报告单位
                        y += 40;
                        rect1 = new Rectangle((int)x1 + 110, (int)y, (int)(x2 - x1), (int)(font_12r.GetHeight(g)));
                        g.DrawString(convertToTradition("姓名:" + textBox_name.Text, ifConvert), font_12r, myBrush, rect1, stringFormat_left);
                        rect1 = new Rectangle((int)x1 + 300, (int)y, (int)(x2 - x1), (int)(font_12r.GetHeight(g)));
                        g.DrawString(convertToTradition("采图站点:" + textBox_site.Text, ifConvert), font_12r, myBrush, rect1, stringFormat_left);
                        y += 40;
                        rect1 = new Rectangle((int)x1 + 110, (int)y, (int)(x2 - x1), (int)(font_12r.GetHeight(g)));
    
                        g.DrawString(convertToTradition("日期:" + DateTime.Parse(label_create_date_inside.Text).ToShortDateString(), ifConvert), font_12r, myBrush, rect1, stringFormat_left);
                        rect1 = new Rectangle((int)x1 + 300, (int)y, (int)(x2 - x1), (int)(font_12r.GetHeight(g)));
                        g.DrawString(convertToTradition("报告单位:" + sitename, ifConvert), font_12r, myBrush, rect1, stringFormat_left);
                        y += 60;
    
                        p1 = new Point((int)x1, (int)y);
                        p2 = new Point((int)x2, (int)y);
                        g.DrawLine(Pens.Gray, p1, p2);
    
                        y += 3;
                        p1 = new Point((int)x1, (int)y);
                        p2 = new Point((int)x2, (int)y);
                        g.DrawLine(Pens.Gray, p1, p2);
                        #endregion
    
                        #region 地址、电话、手机:
                        string m_showAddress = inifile.ReadString("Config", "ShowAddress", "F");
                        if (m_showAddress == "T")
                        {
                            y += 15;
                            rect1 = new Rectangle((int)x1 + 70, (int)y, (int)(x2 - x1), (int)(font_10r.GetHeight(g)));
                            g.DrawString(convertToTradition("地址:" + m_Address, ifConvert), Address_Font, myBrush, rect1, stringFormat_left);
                            rect1 = new Rectangle((int)x1 + 325, (int)y, (int)(x2 - x1), (int)(font_12r.GetHeight(g)));
                            g.DrawString(convertToTradition("电话:" + m_Telephone, ifConvert), Address_Font, myBrush, rect1, stringFormat_left);
                        }
                        #endregion
                        #endregion
                        return true;
                    case 1: //第1页
                        #region 循环系统
                        printHeader(g);
                        y = topMargin + 30;
                        printSysHeader(g, "1", "循环系统", (int)y, true);
    
                        if (pictureBox1.Image != null && pictureBox2.Image != null)
                        {
                            // 插值算法的质量
                            g.InterpolationMode = InterpolationMode.HighQualityBicubic;
    
                            y += 15;
    
                            g.DrawImage(pictureBox1.Image, new Rectangle((int)x1 + 390, (int)y, 228, 304), new Rectangle(0, 0, pictureBox1.Image.Width, pictureBox1.Image.Height), GraphicsUnit.Pixel);
                            y += 315;
                            rect1 = new Rectangle((int)x1 + 392, (int)y - 10, 225, (int)(2 * font_7r.GetHeight(g)));
    
                            //画矩形框
                            Pen rect_temperature = (Pen)Pens.LightGray.Clone();
                            rect_temperature.Width = 1;
                            g.DrawRectangle(rect_temperature, rect1);
    
                            rect1 = new Rectangle((int)x1 + 397, (int)y - 7, 225, (int)(2 * font_7r.GetHeight(g)));
                            g.DrawString(convertToTradition(lab_temperature1.Text, ifConvert), font_7r, myBrush, rect1, stringFormat_left);
    
    
                            //g.DrawString(convertToTradition(lab_temperature1.Text, ifConvert), font_7r, myBrush, rect1, stringFormat_left);
                            y += 25;
                            rect1 = new Rectangle((int)x1 + 393, (int)y, 220, (int)(font_8r.GetHeight(g)));
                            if (primary)
                            {
                                g.DrawString(convertToTradition("" + cmb1.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            else
                            {
                                g.DrawString(convertToTradition("" + E_cmb1.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            y += 22;
                            rect1 = new Rectangle((int)x1 + 393, (int)y, 220, (int)(font_8r.GetHeight(g)));
                            if (primary)
                            {
                                g.DrawString(convertToTradition("" + cmb2.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            else
                            {
                                g.DrawString(convertToTradition("" + E_cmb2.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            y += 22;
                            rect1 = new Rectangle((int)x1 + 393, (int)y, 220, (int)(font_8r.GetHeight(g)));
                            if (primary)
                            {
                                g.DrawString(convertToTradition("" + cmb3.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            else
                            {
                                g.DrawString(convertToTradition("" + E_cmb3.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
    
                            y += 40;
                            p1 = new Point(x1 + 380, y);
                            p2 = new Point(x2, y);
                            g.DrawLine(pen, p1, p2);
    
                            y += 24;
                            g.DrawImage(pictureBox2.Image, new Rectangle((int)x1 + 390, (int)y, 228, 304), new Rectangle(0, 0, pictureBox1.Image.Width, pictureBox1.Image.Height), GraphicsUnit.Pixel);
                            y += 315;
                            rect1 = new Rectangle((int)x1 + 392, (int)y - 10, 225, (int)(2 * font_7r.GetHeight(g)));
    
                            //画矩形框
                            rect_temperature = (Pen)Pens.LightGray.Clone();
                            rect_temperature.Width = 1;
                            g.DrawRectangle(rect_temperature, rect1);
    
                            rect1 = new Rectangle((int)x1 + 397, (int)y - 7, 225, (int)(2 * font_7r.GetHeight(g)));
                            g.DrawString(convertToTradition(lab_temperature2.Text, ifConvert), font_7r, myBrush, rect1, stringFormat_left);
                            y += 25;
                            rect1 = new Rectangle((int)x1 + 393, (int)y, 220, (int)(font_8r.GetHeight(g)));
                            if (primary)
                            {
                                g.DrawString(convertToTradition("" + cmb4.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            else
                            {
                                g.DrawString(convertToTradition("" + E_cmb4.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            y += 22;
                            rect1 = new Rectangle((int)x1 + 393, (int)y, 220, (int)(font_8r.GetHeight(g)));
                            if (primary)
                            {
                                g.DrawString(convertToTradition("" + cmb5.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            else
                            {
                                g.DrawString(convertToTradition("" + E_cmb5.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            y += 22;
                            rect1 = new Rectangle((int)x1 + 393, (int)y, 220, (int)(font_8r.GetHeight(g)));
                            if (primary)
                            {
                                g.DrawString(convertToTradition("" + cmb6.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            else
                            {
                                g.DrawString(convertToTradition("" + E_cmb6.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                        }
                        else
                        {
                            y += 330;
                            rect1 = new Rectangle((int)x1 + 400, (int)y, 209, (int)(font_7r.GetHeight(g)));
                            g.DrawString(convertToTradition(lab_temperature1.Text, ifConvert), font_7r, myBrush, rect1, stringFormat_left);
                            y += 25;
                            rect1 = new Rectangle((int)x1 + 393, (int)y, 220, (int)(font_8r.GetHeight(g)));
                            if (primary)
                            {
                                g.DrawString(convertToTradition("" + cmb1.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            else
                            {
                                g.DrawString(convertToTradition("" + E_cmb1.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            y += 22;
                            rect1 = new Rectangle((int)x1 + 393, (int)y, 220, (int)(font_8r.GetHeight(g)));
                            if (primary)
                            {
                                g.DrawString(convertToTradition("" + cmb2.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            else
                            {
                                g.DrawString(convertToTradition("" + E_cmb2.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            y += 22;
                            rect1 = new Rectangle((int)x1 + 393, (int)y, 220, (int)(font_8r.GetHeight(g)));
                            if (primary)
                            {
                                g.DrawString(convertToTradition("" + cmb3.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            else
                            {
                                g.DrawString(convertToTradition("" + E_cmb3.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
    
                            y += 40;
                            p1 = new Point(x1 + 380, y);
                            p2 = new Point(x2, y);
                            g.DrawLine(pen, p1, p2);
    
                            y += 25;
    
                            y += 314;
                            rect1 = new Rectangle((int)x1 + 400, (int)y, 209, (int)(font_7r.GetHeight(g)));
                            g.DrawString(convertToTradition(lab_temperature2.Text, ifConvert), font_7r, myBrush, rect1, stringFormat_left);
                            y += 25;
                            rect1 = new Rectangle((int)x1 + 393, (int)y, 220, (int)(font_8r.GetHeight(g)));
                            if (primary)
                            {
                                g.DrawString(convertToTradition("" + cmb4.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            else
                            {
                                g.DrawString(convertToTradition("" + E_cmb4.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            y += 22;
                            rect1 = new Rectangle((int)x1 + 393, (int)y, 220, (int)(font_8r.GetHeight(g)));
                            if (primary)
                            {
                                g.DrawString(convertToTradition("" + cmb5.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            else
                            {
                                g.DrawString(convertToTradition("" + E_cmb5.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            y += 22;
                            rect1 = new Rectangle((int)x1 + 393, (int)y, 220, (int)(font_8r.GetHeight(g)));
                            if (primary)
                            {
                                g.DrawString(convertToTradition("" + cmb6.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            else
                            {
                                g.DrawString(convertToTradition("" + E_cmb6.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
    
                        }
    
                        y -= 843;
                        y += 10;
                        if (primary)
                        {
                            for (int i = 0; i < GridView_xunhuan.Rows.Count; i++)
                            {
                                y += 27;
                                printLine(g, (int)y, "1." + (i + 1), GridView_xunhuan.Rows[i].Cells[1].Value.ToString(), subSystems[0][i].reyuanbiaoxian, getSubString(subSystems[0][i].tishi, primary), true);
                            }
                        }
                        else
                        {
                            for (int i = 0; i < E_GridView_xunhuan.Rows.Count; i++)
                            {
                                y += 27;
                                printLine(g, (int)y, "1." + (i + 1), E_GridView_xunhuan.Rows[i].Cells[1].Value.ToString(), subSystems[0][i].reyuanbiaoxian, getSubString(subSystems[0][i].tishi, primary), true);
                            }
                        }
                        y += 30;
                        printSysHeader(g, "2", "呼吸系统", (int)y, true);
                        y += 12;
                        if (primary)
                        {
                            for (int i = 0; i < GridView_huxi.Rows.Count; i++)
                            {
                                y += 27;
                                printLine(g, (int)y, "2." + (i + 1), GridView_huxi.Rows[i].Cells[1].Value.ToString(), subSystems[1][i].reyuanbiaoxian, getSubString(subSystems[1][i].tishi, primary), true);
                            }
                        }
                        else
                        {
                            for (int i = 0; i < E_GridView_huxi.Rows.Count; i++)
                            {
                                y += 27;
                                printLine(g, (int)y, "2." + (i + 1), E_GridView_huxi.Rows[i].Cells[1].Value.ToString(), subSystems[1][i].reyuanbiaoxian, getSubString(subSystems[1][i].tishi, primary), true);
                            }
                        }
    
                        y += 30;
                        printSysHeader(g, "3", "消化系统", (int)y, true);
                        y += 12;
                        if (primary)
                        {
                            for (int i = 0; i < GridView_xiaohua.Rows.Count; i++)
                            {
                                y += 27;
                                printLine(g, (int)y, "3." + (i + 1), GridView_xiaohua.Rows[i].Cells[1].Value.ToString(), subSystems[2][i].reyuanbiaoxian, getSubString(subSystems[2][i].tishi, primary), true);
                            }
                        }
                        else
                        {
                            for (int i = 0; i < E_GridView_xiaohua.Rows.Count; i++)
                            {
                                y += 27;
                                printLine(g, (int)y, "3." + (i + 1), E_GridView_xiaohua.Rows[i].Cells[1].Value.ToString(), subSystems[2][i].reyuanbiaoxian, getSubString(subSystems[2][i].tishi, primary), true);
                            }
                        }
    
                        y += 30;
                        printSysHeader(g, "4", "内分泌、代谢", (int)y, true);
                        y += 12;
                        if (primary)
                        {
                            for (int i = 0; i < GridView_neifenmi.Rows.Count; i++)
                            {
                                y += 27;
                                printLine(g, (int)y, "4." + (i + 1), GridView_neifenmi.Rows[i].Cells[1].Value.ToString(), subSystems[3][i].reyuanbiaoxian, getSubString(subSystems[3][i].tishi, primary), true);
                            }
                        }
                        else
                        {
                            for (int i = 0; i < E_GridView_neifenmi.Rows.Count; i++)
                            {
                                y += 27;
                                printLine(g, (int)y, "4." + (i + 1), E_GridView_neifenmi.Rows[i].Cells[1].Value.ToString(), subSystems[3][i].reyuanbiaoxian, getSubString(subSystems[3][i].tishi, primary), true);
                            }
                        }
    
                        y += 22;
                        p1 = new Point((int)x1, (int)y);
                        p2 = new Point((int)x2, (int)y);
                        g.DrawLine(pen, p1, p2);
    
                        y = 1000;
                        rect1 = new Rectangle((int)x1, (int)y, (int)(x2 - x1), (int)(font_10b.GetHeight(g)));
                        g.DrawString(convertToTradition("第 1 页", ifConvert), font_8r, myBrush, rect1, stringFormat);
    
                        #endregion
                        return true;
                    case 2: //第2页
    
                        #region 运动系统
                        printHeader(g);
                        y = topMargin + 30;
                        printSysHeader(g, "5", "运动系统", (int)y, true);
    
                        if (pictureBox1.Image != null && pictureBox2.Image != null)
                        {
                            // 插值算法的质量
                            g.InterpolationMode = InterpolationMode.HighQualityBicubic;
                            y += 15;
    
                            g.DrawImage(pictureBox3.Image, new Rectangle((int)x1 + 390, (int)y, 228, 304), new Rectangle(0, 0, pictureBox3.Image.Width, pictureBox3.Image.Height), GraphicsUnit.Pixel);
                            y += 315;
                            rect1 = new Rectangle((int)x1 + 392, (int)y - 10, 225, (int)(2 * font_7r.GetHeight(g)));
    
                            //画矩形框
                            Pen rect_temperature = (Pen)Pens.LightGray.Clone();
                            rect_temperature.Width = 1;
                            g.DrawRectangle(rect_temperature, rect1);
    
                            rect1 = new Rectangle((int)x1 + 397, (int)y - 7, 225, (int)(2 * font_7r.GetHeight(g)));
                            g.DrawString(convertToTradition(lab_temperature3.Text, ifConvert), font_7r, myBrush, rect1, stringFormat_left);
                            y += 25;
                            rect1 = new Rectangle((int)x1 + 393, (int)y, 220, (int)(font_8r.GetHeight(g)));
                            if (primary)
                            {
                                g.DrawString(convertToTradition("" + cmb7.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            else
                            {
                                g.DrawString(convertToTradition("" + E_cmb7.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            y += 22;
                            rect1 = new Rectangle((int)x1 + 393, (int)y, 220, (int)(font_8r.GetHeight(g)));
                            if (primary)
                            {
                                g.DrawString(convertToTradition("" + cmb8.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            else
                            {
                                g.DrawString(convertToTradition("" + E_cmb8.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            y += 22;
                            rect1 = new Rectangle((int)x1 + 393, (int)y, 220, (int)(font_8r.GetHeight(g)));
                            if (primary)
                            {
                                g.DrawString(convertToTradition("" + cmb9.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            else
                            {
                                g.DrawString(convertToTradition("" + E_cmb9.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
    
                            y += 45;
                            p1 = new Point(x1 + 380, y);
                            p2 = new Point(x2, y);
                            g.DrawLine(pen, p1, p2);
    
                            y += 25;
                            g.DrawImage(pictureBox4.Image, new Rectangle((int)x1 + 390, (int)y, 228, 304), new Rectangle(0, 0, pictureBox4.Image.Width, pictureBox4.Image.Height), GraphicsUnit.Pixel);
                            y += 315;
                            rect1 = new Rectangle((int)x1 + 392, (int)y - 10, 225, (int)(2 * font_7r.GetHeight(g)));
    
                            //画矩形框
                            rect_temperature = (Pen)Pens.LightGray.Clone();
                            rect_temperature.Width = 1;
                            g.DrawRectangle(rect_temperature, rect1);
    
                            rect1 = new Rectangle((int)x1 + 397, (int)y - 7, 225, (int)(2 * font_7r.GetHeight(g)));
                            g.DrawString(convertToTradition(lab_temperature4.Text, ifConvert), font_7r, myBrush, rect1, stringFormat_left);
                            y += 25;
                            rect1 = new Rectangle((int)x1 + 393, (int)y, 220, (int)(font_8r.GetHeight(g)));
                            if (primary)
                            {
                                g.DrawString(convertToTradition("" + cmb10.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            else
                            {
                                g.DrawString(convertToTradition("" + E_cmb10.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            y += 22;
                            rect1 = new Rectangle((int)x1 + 393, (int)y, 220, (int)(font_8r.GetHeight(g)));
                            if (primary)
                            {
                                g.DrawString(convertToTradition("" + cmb11.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            else
                            {
                                g.DrawString(convertToTradition("" + E_cmb11.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            y += 22;
                            rect1 = new Rectangle((int)x1 + 393, (int)y, 220, (int)(font_8r.GetHeight(g)));
                            if (primary)
                            {
                                g.DrawString(convertToTradition("" + cmb12.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            else
                            {
                                g.DrawString(convertToTradition("" + E_cmb12.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                        }
                        else
                        {
                            y += 330;
                            rect1 = new Rectangle((int)x1 + 400, (int)y, 209, (int)(font_7r.GetHeight(g)));
                            g.DrawString(convertToTradition(lab_temperature3.Text, ifConvert), font_7r, myBrush, rect1, stringFormat_left);
                            y += 25;
                            rect1 = new Rectangle((int)x1 + 393, (int)y, 220, (int)(font_8r.GetHeight(g)));
                            if (primary)
                            {
                                g.DrawString(convertToTradition("" + cmb7.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            else
                            {
                                g.DrawString(convertToTradition("" + E_cmb7.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            y += 22;
                            rect1 = new Rectangle((int)x1 + 393, (int)y, 220, (int)(font_8r.GetHeight(g)));
                            if (primary)
                            {
                                g.DrawString(convertToTradition("" + cmb8.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            else
                            {
                                g.DrawString(convertToTradition("" + E_cmb8.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            y += 22;
                            rect1 = new Rectangle((int)x1 + 393, (int)y, 220, (int)(font_8r.GetHeight(g)));
                            if (primary)
                            {
                                g.DrawString(convertToTradition("" + cmb9.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            else
                            {
                                g.DrawString(convertToTradition("" + E_cmb9.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
    
                            y += 45;
                            p1 = new Point(x1 + 380, y);
                            p2 = new Point(x2, y);
                            g.DrawLine(pen, p1, p2);
    
                            y += 25;
    
                            y += 315;
                            rect1 = new Rectangle((int)x1 + 400, (int)y, 209, (int)(font_7r.GetHeight(g)));
                            g.DrawString(convertToTradition(lab_temperature4.Text, ifConvert), font_7r, myBrush, rect1, stringFormat_left);
                            y += 25;
                            rect1 = new Rectangle((int)x1 + 393, (int)y, 220, (int)(font_8r.GetHeight(g)));
                            if (primary)
                            {
                                g.DrawString(convertToTradition("" + cmb10.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            else
                            {
                                g.DrawString(convertToTradition("" + E_cmb10.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            y += 22;
                            rect1 = new Rectangle((int)x1 + 393, (int)y, 220, (int)(font_8r.GetHeight(g)));
                            if (primary)
                            {
                                g.DrawString(convertToTradition("" + cmb11.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            else
                            {
                                g.DrawString(convertToTradition("" + E_cmb11.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            y += 22;
                            rect1 = new Rectangle((int)x1 + 393, (int)y, 220, (int)(font_8r.GetHeight(g)));
                            if (primary)
                            {
                                g.DrawString(convertToTradition("" + cmb12.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
                            else
                            {
                                g.DrawString(convertToTradition("" + E_cmb12.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                            }
    
                        }
                        y -= 849;
                        y += 10;
                        if (primary)
                        {
                            for (int i = 0; i < GridView_yundong.Rows.Count; i++)
                            {
                                y += 27;
                                printLine(g, (int)y, "5." + (i + 1), GridView_yundong.Rows[i].Cells[1].Value.ToString(), subSystems[4][i].reyuanbiaoxian, getSubString(subSystems[4][i].tishi, primary), true);
                            }
                        }
                        else
                        {
                            for (int i = 0; i < E_GridView_yundong.Rows.Count; i++)
                            {
                                y += 27;
                                printLine(g, (int)y, "5." + (i + 1), E_GridView_yundong.Rows[i].Cells[1].Value.ToString(), subSystems[4][i].reyuanbiaoxian, getSubString(subSystems[4][i].tishi, primary), true);
                            }
                        }
                        y += 30;
                        printSysHeader(g, "6", "生殖、泌尿", (int)y, true);
                        y += 12;
                        if (primary)
                        {
                            for (int i = 0; i < GridView_miniao.Rows.Count; i++)
                            {
                                y += 27;
                                printLine(g, (int)y, "6." + (i + 1), GridView_miniao.Rows[i].Cells[1].Value.ToString(), subSystems[5][i].reyuanbiaoxian, getSubString(subSystems[5][i].tishi, primary), true);
                            }
                        }
                        else
                        {
                            for (int i = 0; i < E_GridView_miniao.Rows.Count; i++)
                            {
                                y += 27;
                                printLine(g, (int)y, "6." + (i + 1), E_GridView_miniao.Rows[i].Cells[1].Value.ToString(), subSystems[5][i].reyuanbiaoxian, getSubString(subSystems[5][i].tishi, primary), true);
                            }
                        }
    
                        y += 30;
                        printSysHeader(g, "7", "其他", (int)y, true);
                        y += 12;
                        if (primary)
                        {
                            for (int i = 0; i < GridView_qita.Rows.Count; i++)
                            {
                                y += 27;
                                printLine(g, (int)y, "7." + (i + 1), GridView_qita.Rows[i].Cells[1].Value.ToString(), subSystems[6][i].reyuanbiaoxian, getSubString(subSystems[6][i].tishi, primary), true);
                            }
                        }
                        else
                        {
                            for (int i = 0; i < E_GridView_qita.Rows.Count; i++)
                            {
                                y += 27;
                                printLine(g, (int)y, "7." + (i + 1), E_GridView_qita.Rows[i].Cells[1].Value.ToString(), subSystems[6][i].reyuanbiaoxian, getSubString(subSystems[6][i].tishi, primary), true);
                            }
                        }
    
                        if (!checkBox_linchuang.Checked)
                        {
                            y += 30;
                            g.FillRectangle(printBg, x1, y, x1 + 295, (int)(font_10b.GetHeight(g) + 13));
                            y += 6;
    
                            rect1 = new Rectangle((int)x1 + 10, (int)y, 20, (int)(font_10b.GetHeight(g) + 12));
                            g.DrawString("8", font_10b, myBrush, rect1, stringFormat_left);
    
                            rect1 = new Rectangle((int)x1 + 50, (int)y, 200, (int)(font_10b.GetHeight(g) + 12));
                            g.DrawString(convertToTradition("中医辨证", ifConvert), font_10b, myBrush, rect1, stringFormat_left);
    
                            y += 33;
    
                            if (primary)
                            {
                                ifPrintNum = zhongyibianzheng2_comboBox.Text != "";
    
                                if (zhongyibianzheng1_comboBox.Text != "")
                                {
                                    rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2, (int)(font_10b.GetHeight(g)));
                                    g.DrawString((ifPrintNum ? "1. " : "   ") + convertToTradition(zhongyibianzheng1_comboBox.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
    
    
                                }
                                y += 27;
                                if (zhongyibianzheng2_comboBox.Text != "")
                                {
                                    rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2, (int)(font_10b.GetHeight(g)));
                                    g.DrawString((ifPrintNum ? "2. " : "   ") + convertToTradition(zhongyibianzheng2_comboBox.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                                }
                            }
                            else
                            {
                                ifPrintNum = E_zhongyibianzheng2_comboBox.Text != "";
    
                                if (E_zhongyibianzheng1_comboBox.Text != "")
                                {
                                    rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2, (int)(font_10b.GetHeight(g)));
                                    g.DrawString((ifPrintNum ? "1.  " : "    ") + convertToTradition(E_zhongyibianzheng1_comboBox.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
    
                                }
                                y += 27;
                                if (E_zhongyibianzheng2_comboBox.Text != "")
                                {
                                    rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2, (int)(font_10b.GetHeight(g)));
                                    g.DrawString((ifPrintNum ? "2.  " : "    ") + convertToTradition(E_zhongyibianzheng2_comboBox.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
    
    
                                }
                            }
    
                            y += 30;
    
                            g.FillRectangle(printBg, x1, y, x1 + 295, (int)(font_10b.GetHeight(g) + 13));
    
                            y += 6;
    
                            rect1 = new Rectangle((int)x1 + 10, (int)y, 20, (int)(font_10b.GetHeight(g) + 12));
                            g.DrawString("9", font_10b, myBrush, rect1, stringFormat_left);
    
                            rect1 = new Rectangle((int)x1 + 50, (int)y, 200, (int)(font_10b.GetHeight(g) + 12));
                            g.DrawString(convertToTradition("中医体质 / 亚健康证型", ifConvert), font_10b, myBrush, rect1, stringFormat_left);
    
                            y += 33;
    
                            if (primary)
                            {
                                ifPrintNum2 = zhengxing2_comboBox.Text != "";
    
                                if (zhengxing1_comboBox.Text != "")
                                {
                                    rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2, (int)(font_10b.GetHeight(g)));
                                    g.DrawString((ifPrintNum2 ? "1. " : "   ") + convertToTradition(zhengxing1_comboBox.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
    
                                }
                                y += 27;
    
                                if (zhengxing2_comboBox.Text != "")
                                {
                                    rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2, (int)(font_10b.GetHeight(g)));
                                    g.DrawString((ifPrintNum2 ? "2. " : "   ") + convertToTradition(zhengxing2_comboBox.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                                }
                            }
                            else
                            {
                                ifPrintNum2 = zhengxing2_comboBox.Text != "";
    
                                if (E_zhengxing1_comboBox.Text != "")
                                {
                                    rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2, (int)(font_10b.GetHeight(g)));
                                    g.DrawString((ifPrintNum2 ? "1. " : "     ") + convertToTradition(E_zhengxing1_comboBox.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                                }
                                y += 27;
                                if (E_zhengxing2_comboBox.Text != "")
                                {
                                    rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2, (int)(font_10b.GetHeight(g)));
                                    g.DrawString((ifPrintNum ? "2. " : "     ") + convertToTradition(E_zhengxing2_comboBox.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
    
                                }
    
                            }
                            if (sex == "M")
                            {
                                y += 62;
    
                                p1 = new Point((int)x1, (int)y);
                                p2 = new Point((int)x2, (int)y);
                                g.DrawLine(pen, p1, p2);
                            }
                            else
                            {
                                y += 28;
    
                                p1 = new Point((int)x1, (int)y);
                                p2 = new Point((int)x2, (int)y);
                                g.DrawLine(pen, p1, p2);
                            }
                        }
                        y = 1000;
                        rect1 = new Rectangle((int)x1, (int)y, (int)(x2 - x1), (int)(font_10b.GetHeight(g)));
                        g.DrawString(convertToTradition("第 2 页", ifConvert), font_8r, myBrush, rect1, stringFormat);
    
                        #endregion
                        return true;
                    case 3://第3页
                        #region 总评建议
                        printHeader(g);
                        y = topMargin + 30;
                        g.FillRectangle(printBg, x1, y, (int)(x2 - x1), (int)(font_10b.GetHeight(g) + 12));
                        y += 5;
    
                        rect1 = new Rectangle((int)x1 + 40, (int)y, 200, (int)(font_10b.GetHeight(g) + 12));
                        g.DrawString(convertToTradition("总评建议", ifConvert), font_10b, myBrush, rect1, stringFormat_left);
    
                        y += 42;
    
                        rect1 = new Rectangle((int)x1 + 20, (int)y, 200, (int)(font_10b.GetHeight(g) + 12));
                        g.DrawString(convertToTradition("主要问题:", ifConvert), font_9b, myBrush, rect1, stringFormat_left);
    
                        y += 30;
                        if (primary)
                        {
                            ifPrintNum = zhuyaowenti2_comboBox.Text != "";
                            if (zhuyaowenti1_comboBox.Text != "")
                            {
                                rect1 = new Rectangle(x1 + 20, y, (printWidth - sideMargin * 2) / 2 - 10, (int)(font_10b.GetHeight(g)));
                                g.DrawString((ifPrintNum ? "1.  " : "    ") + convertToTradition(zhuyaowenti1_comboBox.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
                            }
                            y += 27;
                            if (zhuyaowenti2_comboBox.Text != "")
                            {
                                rect1 = new Rectangle(x1 + 20, y, (printWidth - sideMargin * 2) / 2 - 10, (int)(font_10b.GetHeight(g)));
                                g.DrawString((ifPrintNum ? "2.  " : "    ") + convertToTradition(zhuyaowenti2_comboBox.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
                            }
                            y += 27;
                            if (zhuyaowenti3_comboBox.Text != "")
                            {
                                rect1 = new Rectangle(x1 + 20, y, (printWidth - sideMargin * 2) / 2 - 10, (int)(font_10b.GetHeight(g)));
                                g.DrawString((ifPrintNum ? "3.  " : "    ") + convertToTradition(zhuyaowenti3_comboBox.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
                            }
                        }
                        else
                        {
                            ifPrintNum = E_zhuyaowenti2_comboBox.Text != "";
                            if (E_zhuyaowenti1_comboBox.Text != "")
                            {
                                rect1 = new Rectangle(x1 + 20, y, (printWidth - sideMargin * 2) / 2 - 10, (int)(font_10b.GetHeight(g)));
                                g.DrawString((ifPrintNum ? "1.  " : "    ") + convertToTradition(E_zhuyaowenti1_comboBox.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
                            }
                            y += 27;
                            if (E_zhuyaowenti2_comboBox.Text != "")
                            {
                                rect1 = new Rectangle(x1 + 20, y, (printWidth - sideMargin * 2) / 2 - 10, (int)(font_10b.GetHeight(g)));
                                g.DrawString((ifPrintNum ? "2.  " : "    ") + convertToTradition(E_zhuyaowenti2_comboBox.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
                            }
                            y += 27;
                            if (E_zhuyaowenti3_comboBox.Text != "")
                            {
                                rect1 = new Rectangle(x1 + 20, y, (printWidth - sideMargin * 2) / 2 - 10, (int)(font_10b.GetHeight(g)));
                                g.DrawString((ifPrintNum ? "3.  " : "    ") + convertToTradition(E_zhuyaowenti3_comboBox.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
                            }
    
                        }
                        y -= 84;
    
                        rect1 = new Rectangle((int)x1 + ((printWidth - sideMargin * 2) / 2), (int)y, (printWidth - sideMargin * 2) / 2 - 10, (int)(font_10b.GetHeight(g) + 12));
                        g.DrawString(convertToTradition("需要关注:", ifConvert), font_9b, myBrush, rect1, stringFormat_left);
    
                        y += 30;
    
                        if (primary)
                        {
                            ifPrintNum = textBox_xuyaoguanzhu2.Text != "";
    
                            if (textBox_xuyaoguanzhu1.Text != "")
                            {
                                rect1 = new Rectangle((int)x1 + ((printWidth - sideMargin * 2) / 2), (int)y, (printWidth - sideMargin * 2) / 2 - 10, (int)(font_10b.GetHeight(g)));
                                g.DrawString(convertToTradition("" + textBox_xuyaoguanzhu1.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
                            }
                            y += 27;
                            if (textBox_xuyaoguanzhu2.Text != "")
                            {
                                rect1 = new Rectangle((int)x1 + ((printWidth - sideMargin * 2) / 2), (int)y, (printWidth - sideMargin * 2) / 2 - 10, (int)(font_10b.GetHeight(g)));
                                g.DrawString(convertToTradition("" + textBox_xuyaoguanzhu2.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
                            }
                            y += 27;
                            if (textBox_xuyaoguanzhu3.Text != "")
                            {
                                rect1 = new Rectangle((int)x1 + ((printWidth - sideMargin * 2) / 2), (int)y, (printWidth - sideMargin * 2) / 2 - 10, (int)(font_10b.GetHeight(g)));
                                g.DrawString(convertToTradition("" + textBox_xuyaoguanzhu3.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
                            }
                        }
                        else
                        {
    
                            ifPrintNum = E_textBox_xuyaoguanzhu2.Text != "";
    
                            if (E_textBox_xuyaoguanzhu1.Text != "")
                            {
                                rect1 = new Rectangle((int)x1 + ((printWidth - sideMargin * 2) / 2), (int)y, (printWidth - sideMargin * 2) / 2 - 10, (int)(font_10b.GetHeight(g)));
                                g.DrawString(convertToTradition(E_textBox_xuyaoguanzhu1.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
                            }
                            y += 27;
                            if (E_textBox_xuyaoguanzhu2.Text != "")
                            {
                                rect1 = new Rectangle((int)x1 + ((printWidth - sideMargin * 2) / 2), (int)y, (printWidth - sideMargin * 2) / 2 - 10, (int)(font_10b.GetHeight(g)));
                                g.DrawString(convertToTradition(E_textBox_xuyaoguanzhu2.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
                            }
                            y += 27;
                            if (E_textBox_xuyaoguanzhu3.Text != "")
                            {
                                rect1 = new Rectangle((int)x1 + ((printWidth - sideMargin * 2) / 2), (int)y, (printWidth - sideMargin * 2) / 2 - 10, (int)(font_10b.GetHeight(g)));
                                g.DrawString(convertToTradition(E_textBox_xuyaoguanzhu3.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
                            }
    
                        }
    
                        y += 30;
                        p1 = new Point((int)x1, (int)y + 9);
                        p2 = new Point((int)x2, (int)y + 9);
                        g.DrawLine(Pens.LightGray, p1, p2);
    
                        y += 27;
    
                        if (!checkBox_linchuang.Checked)
                        {
                            rect1 = new Rectangle((int)x1 + 20, (int)y, 200, (int)(font_10b.GetHeight(g) + 12));
                            g.DrawString(convertToTradition("检查建议:", ifConvert), font_9b, myBrush, rect1, stringFormat_left);
    
                            if (primary)
                            {
                                y += 30;
    
                                ifPrintNum = textBox_jianchajianyi2.Text != "";
                                if (textBox_jianchajianyi1.Text != "")
                                {
                                    rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2, (int)(font_10b.GetHeight(g)));
                                    g.DrawString((ifPrintNum ? "1.  " : "    ") + convertToTradition(textBox_jianchajianyi1.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
                                }
                                y += 27;
                                if (textBox_jianchajianyi2.Text != "")
                                {
                                    rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2, (int)(font_10b.GetHeight(g)));
                                    g.DrawString((ifPrintNum ? "2.  " : "    ") + convertToTradition(textBox_jianchajianyi2.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
                                }
                                y += 27;
                                if (textBox_jianchajianyi3.Text != "")
                                {
                                    rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2, (int)(font_10b.GetHeight(g)));
                                    g.DrawString((ifPrintNum ? "3.  " : "    ") + convertToTradition(textBox_jianchajianyi3.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
                                }
                            }
                            else
                            {
                                y += 20;
    
                                ifPrintNum = E_textBox_jianchajianyi2.Text != "";
                                if (E_textBox_jianchajianyi1.Text != "")
                                {
                                    rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2, (int)(font_10b.GetHeight(g)));
                                    g.DrawString((ifPrintNum ? "1.  " : "    ") + convertToTradition(E_textBox_jianchajianyi1.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
                                }
                                y += 25;
                                if (E_textBox_jianchajianyi2.Text != "")
                                {
                                    rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2, (int)(font_10b.GetHeight(g)));
                                    g.DrawString((ifPrintNum ? "2.  " : "    ") + convertToTradition(E_textBox_jianchajianyi2.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
                                }
                                y += 25;
                                if (E_textBox_jianchajianyi3.Text != "")
                                {
                                    rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2, (int)(font_10b.GetHeight(g)));
                                    g.DrawString((ifPrintNum ? "3.  " : "    ") + convertToTradition(E_textBox_jianchajianyi3.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
                                }
    
                            }
    
                            y += 30;
                            p1 = new Point((int)x1, (int)y + 9);
                            p2 = new Point((int)x2, (int)y + 9);
                            g.DrawLine(Pens.LightGray, p1, p2);
    
                            y += 27;
    
                            rect1 = new Rectangle((int)x1 + 20, (int)y, 200, (int)(font_10b.GetHeight(g) + 12));
                            g.DrawString(convertToTradition("保健建议:", ifConvert), font_9b, myBrush, rect1, stringFormat_left);
    
                            if (primary)
                            {
                                y += 30;
                                ifPrintNum = textBox_baojianjianyi2.Text != "";
                                if (textBox_baojianjianyi1.Text != "")
                                {
                                    rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2 - 35, 4 * (int)(font_10b.GetHeight(g)));
                                    g.DrawString((ifPrintNum ? "1.  " : "    "), font_8r1, myBrush, rect1, stringFormat_left);
                                    rect1 = new Rectangle(x1 + 35, y, printWidth - sideMargin * 2 - 35, 4 * (int)(font_10b.GetHeight(g)));
                                    g.DrawString(convertToTradition(textBox_baojianjianyi1.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
                                }
                                y += 40;
                                if (textBox_baojianjianyi2.Text != "")
                                {
                                    rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2 - 35, 4 * (int)(font_10b.GetHeight(g)));
                                    //g.DrawString((ifPrintNum ? "2.  " : "    ") + convertToTradition(textBox_baojianjianyi2.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                                    g.DrawString((ifPrintNum ? "2.  " : "    "), font_8r1, myBrush, rect1, stringFormat_left);
                                    rect1 = new Rectangle(x1 + 35, y, printWidth - sideMargin * 2 - 35, 4 * (int)(font_10b.GetHeight(g)));
                                    g.DrawString(convertToTradition(textBox_baojianjianyi2.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
    
                                }
                                y += 40;
                                if (textBox_baojianjianyi3.Text != "")
                                {
                                    rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2 - 35, 4 * (int)(font_10b.GetHeight(g)));
                                    //g.DrawString((ifPrintNum ? "3.  " : "    ") + convertToTradition(textBox_baojianjianyi3.Text, ifConvert), font_8r, myBrush, rect1, stringFormat_left);
                                    g.DrawString((ifPrintNum ? "3.  " : "    "), font_8r1, myBrush, rect1, stringFormat_left);
                                    rect1 = new Rectangle(x1 + 35, y, printWidth - sideMargin * 2 - 35, 4 * (int)(font_10b.GetHeight(g)));
                                    g.DrawString(convertToTradition(textBox_baojianjianyi3.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
                                }
                            }
                            else
                            {
                                y += 30;
                                ifPrintNum = E_textBox_baojianjianyi2.Text != "";
                                if (E_textBox_baojianjianyi1.Text != "")
                                {
                                    rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2 - 40, 4 * (int)(font_10b.GetHeight(g)));
                                    g.DrawString((ifPrintNum ? "1.  " : "    ") + convertToTradition(E_textBox_baojianjianyi1.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
                                }
                                y += 40;
                                if (textBox_baojianjianyi2.Text != "")
                                {
                                    rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2 - 40, 4 * (int)(font_10b.GetHeight(g)));
                                    g.DrawString((ifPrintNum ? "2.  " : "    ") + convertToTradition(E_textBox_baojianjianyi2.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
                                }
                                y += 40;
                                if (E_textBox_baojianjianyi3.Text != "")
                                {
                                    rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2 - 40, 4 * (int)(font_10b.GetHeight(g)));
                                    g.DrawString((ifPrintNum ? "3.  " : "    ") + convertToTradition(E_textBox_baojianjianyi3.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
                                }
    
    
                            }
    
                            y += 40;
                            p1 = new Point((int)x1, (int)y + 9);
                            p2 = new Point((int)x2, (int)y + 9);
                            g.DrawLine(Pens.LightGray, p1, p2);
    
                            y += 27;
    
                            if (primary)
                            {
                                if (fujian1_comboBox.Text != "" || fujian2_comboBox.Text != "" || fujian3_comboBox.Text != "")
                                {
                                    rect1 = new Rectangle((int)x1 + 20, (int)y, 200, (int)(font_10b.GetHeight(g) + 12));
                                    g.DrawString(convertToTradition("参考文献:", ifConvert), font_9b, myBrush, rect1, stringFormat_left);
                                    ifPrintNum = fujian2_comboBox.Text != "";
                                    y += 25;
                                    if (fujian1_comboBox.Text != "")
                                    {
                                        rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2, (int)(font_10b.GetHeight(g)));
                                        g.DrawString((ifPrintNum ? "1.  " : "    ") + convertToTradition(fujian1_comboBox.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
                                    }
                                    y += 25;
                                    if (fujian2_comboBox.Text != "")
                                    {
                                        rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2, (int)(font_10b.GetHeight(g)));
                                        g.DrawString((ifPrintNum ? "2.  " : "    ") + convertToTradition(fujian2_comboBox.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
                                    }
                                    y += 25;
                                    if (fujian3_comboBox.Text != "")
                                    {
                                        rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2, (int)(font_10b.GetHeight(g)));
                                        g.DrawString((ifPrintNum ? "3.  " : "    ") + convertToTradition(fujian3_comboBox.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
                                    }
                                    y += 23;
                                    p1 = new Point((int)x1, (int)y + 10);
                                    p2 = new Point((int)x2, (int)y + 10);
                                    g.DrawLine(Pens.LightGray, p1, p2);
                                }
                                else
                                {
                                    y += 25;
                                    y += 25;
                                    y += 25;
                                }
                            }
                            else
                            {
                                if (E_fujian1_comboBox.Text != "" || E_fujian2_comboBox.Text != "" || E_fujian3_comboBox.Text != "")
                                {
                                    rect1 = new Rectangle((int)x1 + 20, (int)y, 200, (int)(font_10b.GetHeight(g) + 12));
                                    g.DrawString(convertToTradition("参考文献:", ifConvert), font_9b, myBrush, rect1, stringFormat_left);
                                    ifPrintNum = E_fujian2_comboBox.Text != "";
                                    y += 25;
                                    if (E_fujian1_comboBox.Text != "")
                                    {
                                        rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2, (int)(font_10b.GetHeight(g)));
                                        g.DrawString((ifPrintNum ? "1.  " : "    ") + convertToTradition(E_fujian1_comboBox.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
                                    }
                                    y += 25;
                                    if (E_fujian2_comboBox.Text != "")
                                    {
                                        rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2, (int)(font_10b.GetHeight(g)));
                                        g.DrawString((ifPrintNum ? "2.  " : "    ") + convertToTradition(E_fujian2_comboBox.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
                                    }
                                    y += 25;
                                    if (E_fujian3_comboBox.Text != "")
                                    {
                                        rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2, (int)(font_10b.GetHeight(g)));
                                        g.DrawString((ifPrintNum ? "3.  " : "    ") + convertToTradition(E_fujian3_comboBox.Text, ifConvert), font_8r1, myBrush, rect1, stringFormat_left);
                                    }
                                    y += 23;
                                    p1 = new Point((int)x1, (int)y + 10);
                                    p2 = new Point((int)x2, (int)y + 10);
                                    g.DrawLine(Pens.LightGray, p1, p2);
                                }
                                else
                                {
                                    y += 25;
                                    y += 25;
                                    y += 25;
                                }
                            }
    
                        }
                        else
                        {
                            y += 400;
                        }
    
                        y += 60;
    
                        g.InterpolationMode = InterpolationMode.HighQualityBicubic;
    
                        rect1 = new Rectangle((int)x1 + 350, (int)y, 500, (int)(font_10b.GetHeight(g) + 10));
                        g.DrawString(convertToTradition("评估师:", ifConvert), font_10r, myBrush, rect1, stringFormat_left);
                        rect1 = new Rectangle((int)x1 + 405, (int)y - signature.Height * 70 / signature.Width / 2, 70, signature.Height * 70 / signature.Width);
                        g.DrawImage(signature, rect1, new Rectangle(0, 0, signature.Width, signature.Height), GraphicsUnit.Pixel);
                        //g.DrawString(pinggushi_textBox.Text, font_10r, myBrush, rect1, stringFormat_left);
                        rect1 = new Rectangle((int)x1 + 480, (int)y, 500, (int)(font_9r.GetHeight(g) + 10));
                        g.DrawString(dateTimePicker_inside.Value.ToShortDateString(), font_9r, myBrush, rect1, stringFormat_left);
    
                        y += 25;
                        p1 = new Point((int)x1, (int)y + 10);
                        p2 = new Point((int)x2, (int)y + 10);
                        g.DrawLine(pen, p1, p2);
    
                        y += 30;
                        rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2 - 30, 4 * (int)(font_22r.GetHeight(g)));
                        //g.DrawString(convertToTradition("      TMI 人体热代谢层像技术,以其安全、敏感、全面的独特优势,在细胞热代谢功能水平上对人体健康状态进行动态监测;包括较早期地发现无主诉或临床检测尚未发现的病灶、重大疾病隐患以及亚健康状态的评估分析。本报告不作为临床诊断结果。", ifConvert), font_7r, myBrush, rect1, stringFormat_left);
                        //
                        g.DrawString(convertToTradition("    TMI 人体代谢热层像技术,以其安全、敏感、全面的独特优势,在细胞热代谢功能水平上以中西医结合的方式,对人体健康状态", ifConvert), font_7r1, myBrush, rect1, stringFormat_left);
    
                        y += 20;
                        rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2 - 30, 4 * (int)(font_22r.GetHeight(g)));
                        g.DrawString(convertToTradition("进行整体性动态检测;可较早发现一些无主诉或临床检查未发现的病灶以及部分重大疾病隐患,包括对亚健康状态的评估分析。", ifConvert), font_7r1, myBrush, rect1, stringFormat_left);
    
                        y += 20;
    
                        rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2 - 30, 4 * (int)(font_22r.GetHeight(g)));
                        g.DrawString(convertToTradition("    TMI 作为新一代医学功能影像技术,是对医疗机构与体检中心等临床常规检查的一种极佳补充;但其报告不作为临床诊断结果。", ifConvert), font_7r1, myBrush, rect1, stringFormat_left);
                        y += 20;
    
                        rect1 = new Rectangle(x1 + 20, y, printWidth - sideMargin * 2 - 30, 4 * (int)(font_22r.GetHeight(g)));
                        g.DrawString(convertToTradition("如本报告分析结果与临床检查结果有所不符,则视具体情况着重参考临床检查结果。本报告对评估项所见问题程度的分级表达:", ifConvert), font_7r1, myBrush, rect1, stringFormat_left);
                        y += 23;
    
                        //rect1 = new Rectangle(520, y+1, (printWidth - sideMargin * 2), 4 * (int)(font_9r.GetHeight(g)));
                        //g.DrawString(convertToTradition("  如需咨询与服务,请登录:", ifConvert), font_7r1, myBrush, rect1, stringFormat_left);
    
                        pb_code.Visible = true;
                        Bitmap bp = new Bitmap(70, 70);
                        rect1 = new Rectangle(0, 0, bp.Width, bp.Height);
                        pb_code.DrawToBitmap(bp, rect1);
                        g.DrawImage(bp, 570, y + 8, bp.Width, bp.Height);
                        pb_code.Visible = false;
    
                        g.DrawImage(Properties.Resources.RED, x1 + 35, y, 20, 20);
    
                        rect1 = new Rectangle(x1 + 60, y + 1, 200, (int)(font_8r.GetHeight(g) + 10));
                        g.DrawString(convertToTradition("异常:", ifConvert), font_7b, myBrush, rect1, stringFormat_left);
                        rect1 = new Rectangle(x1 + 90, y + 1, printWidth - sideMargin * 2 - 40, (int)(font_7r1.GetHeight(g) + 10));
                        g.DrawString(convertToTradition(" 其图像特征很明显、高度疑似评估提示所指病症,相应的临床检查结果多呈阳性;", ifConvert), font_7r01, myBrush, rect1, stringFormat_left);
    
                        y += 20;
    
                        g.DrawImage(Properties.Resources.Orange, x1 + 35, y, 20, 20);
    
                        rect1 = new Rectangle(x1 + 60, y + 1, 200, (int)(font_7r.GetHeight(g) + 10));
                        g.DrawString(convertToTradition("临界:", ifConvert), font_7b, myBrush, rect1, stringFormat_left);
                        rect1 = new Rectangle(x1 + 90, y + 1, printWidth - sideMargin * 2 - 40, 4 * (int)(font_7r1.GetHeight(g)));
                        g.DrawString(convertToTradition(" 其图像特征较明显、处于疾病的临界状态,相应的临床检查结果可能阳性或阴性;", ifConvert), font_7r01, myBrush, rect1, stringFormat_left);
    
                        y += 20;
    
                        g.DrawImage(Properties.Resources.YELLOW, x1 + 35, y, 20, 20);
    
                        rect1 = new Rectangle(x1 + 60, y + 1, 200, (int)(font_7r.GetHeight(g) + 10));
                        g.DrawString(convertToTradition("隐患:", ifConvert), font_7b, myBrush, rect1, stringFormat_left);
                        rect1 = new Rectangle(x1 + 90, y + 1, printWidth - sideMargin * 2 - 40, 4 * (int)(font_7r1.GetHeight(g)));
                        g.DrawString(convertToTradition(" 其图像特征不明显、但有功能性改变的早期征象,相应的临床检查结果多为阴性;", ifConvert), font_7r01, myBrush, rect1, stringFormat_left);
    
                        y += 20;
    
                        g.DrawImage(Properties.Resources.GREEN, x1 + 35, y, 20, 20);
    
                        rect1 = new Rectangle(x1 + 60, y + 1, 200, (int)(font_7b.GetHeight(g) + 10));
                        g.DrawString(convertToTradition("未见异常:", ifConvert), font_7b, myBrush, rect1, stringFormat_left);
                        rect1 = new Rectangle(x1 + 105, y + 1, printWidth - sideMargin * 2 - 40, 4 * (int)(font_7r.GetHeight(g)));
                        g.DrawString(convertToTradition("  其图像未见明显特征表现,但或许是一过性假象,故不等于正常或没有问题。", ifConvert), font_7r01, myBrush, rect1, stringFormat_left);
    
    
    
                        y += 40;
    
                        //
                        p1 = new Point((int)x1, (int)y);
                        p2 = new Point((int)x2, (int)y);
                        g.DrawLine(pen, p1, p2);
                        y += 2;
                        p1 = new Point((int)x1, (int)y);
                        p2 = new Point((int)x2, (int)y);
                        g.DrawLine(pen, p1, p2);
    
                        y = 1000;
                        rect1 = new Rectangle((int)x1, (int)y, (int)(x2 - x1), (int)(font_10b.GetHeight(g)));
                        g.DrawString(convertToTradition("第 3 页", ifConvert), font_8r, myBrush, rect1, stringFormat);
                        #endregion
                        return false;
                }
                return false;
            }
  • 相关阅读:
    迟滞电压比较器
    单调谐小信号放大器
    汇编指令
    渗透测试之信息收集
    DVWA——文件包含
    DVWA——文件上传
    文件上传漏洞与利用
    在Metasploit中使用PostgreSQL
    软件安装方法
    XML外部实体(XXE)
  • 原文地址:https://www.cnblogs.com/gaara-zhang/p/9681443.html
Copyright © 2011-2022 走看看