コード例 #1
0
        public void ShowImgData(ImageInfoModel ImgInfo)
        {
            try
            {
                ClearDV3();

                //1.抬头

                StringBuilder titleSb = new StringBuilder();
                foreach (var item in ImgInfo.titleDic)
                {
                    titleSb.AppendLine(String.Format("{0}:{1}", item.Key, item.Value));
                }

                this.richTextBox1.Text = titleSb.ToString();

                //2.行明细

                if (ImgInfo.lineList != null && ImgInfo.lineList.Count > 0)
                {
                    List <String> firLineList = ImgInfo.lineList.First();
                    for (int i = 0; i < firLineList.Count; i++)
                    {
                        this.dataGridView3.Columns.Add(string.Format("{0}{1}", "Columns", i), string.Format("{0}{1}", "列", i));
                    }
                    this.dataGridView3.Rows.Add(ImgInfo.lineList.Count);

                    for (int lineIdx = 0; lineIdx < ImgInfo.lineList.Count; lineIdx++)
                    {
                        for (int colIdx = 0; colIdx < firLineList.Count; colIdx++)
                        {
                            this.dataGridView3.Rows[lineIdx].Cells[colIdx].Value = ImgInfo.lineList[lineIdx][colIdx];
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
コード例 #2
0
 public void ShowImg(ImageInfoModel ImgInfo)
 {
     this.pictureBox1.Image = Image.FromFile("D:\\07007246.jpg");
 }