我如何在datagridview中的printDokument _Printpage中绘制图片?

时间:2017-02-15 06:48:25

标签: .net

我知道绘制字符串DataGrid,但我无法绘制图片。 请告诉我,我应该如何从DataGridView中绘制图像。

enter image description here

我用过:e.graphics.DrawImage(最后一行)

                e.Graphics.DrawString(dataGridView_nahlad.Columns[9].HeaderText.ToString(), new Font("Microsoft Sans Serif", 12, FontStyle.Bold), Brushes.Black, new Point(450, 55));
            e.Graphics.DrawString(dataGridView_nahlad.Rows[0].Cells[9].FormattedValue.ToString(), new Font("Microsoft Sans Serif", 12, FontStyle.Bold), Brushes.Black, new Point(520, 55));

            e.Graphics.DrawString(dataGridView_nahlad.Columns[10].HeaderText.ToString(), new Font("Microsoft Sans Serif", 12, FontStyle.Bold), Brushes.Black, new Point(450, 75));
            e.Graphics.DrawString(dataGridView_nahlad.Rows[0].Cells[10].FormattedValue.ToString(), new Font("Microsoft Sans Serif", 12, FontStyle.Bold), Brushes.Black, new Point(520, 75));

            // vykreslenie čiar

            e.Graphics.DrawLine(new Pen (Brushes.Black, 3), 75 ,190,740,190);
            e.Graphics.DrawLine(new Pen(Brushes.Black, 3), 75, 45, 740, 45);

            //vykreslenie Qrcodu
            e.Graphics.DrawImage(dataGridView_nahlad.Rows[0].Cells[12]    , 620, 55, 120, 120);

0 个答案:

没有答案