if (resultCaseInfo != null && resultCaseInfo.data != null && resultCaseInfo.data.documents != null && resultCaseInfo.data.documents.Count() > 0)
                    {
                        this.flowLayoutPanel_img.Controls.Clear();
                        foreach (TmDocuments item in resultCaseInfo.data.documents)
                        {
                            WebResult<string> fileParamResult = EHRMgr.GetFapiPrivateParam(item.uri);
                            if (WebResultCode.CALL_SUCCESS.REquals(fileParamResult.code) && !String.IsNullOrWhiteSpace(fileParamResult.data))
                            {
                                PictureBox picbox = new PictureBox();
                                picbox.Size = new System.Drawing.Size(120, 120);
                                picbox.BackColor = Color.Black;
                                picbox.Margin = new Padding(3);
                                picbox.SizeMode = PictureBoxSizeMode.Zoom;
                                picbox.ImageLocation = FileServerExtBaseUrl + "/FileServiceWeb/api/FileoutputServlet/get?p=" + fileParamResult.data;
                                picbox.DoubleClick += new System.EventHandler(this.picbox_DoubleClick); //+=后双击tab出现 void picbox_DoubleClick
                                this.flowLayoutPanel_img.Controls.Add(picbox);
                            }
                        }
                    } 
                   
     /// <summary>
        /// 双击事件弹出新的窗口展示图片
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
void picbox_DoubleClick(object sender, EventArgs e)
        {
            Form form = new Form();
            PictureBox picbox = new PictureBox();
            form.Size = new Size(800, 600);
            form.StartPosition = FormStartPosition.CenterScreen;
            form.Text = "图像查看";
            picbox.Dock = DockStyle.Fill;
            picbox.Image = (sender as PictureBox).Image;
            picbox.SizeMode = PictureBoxSizeMode.Zoom;
            picbox.BackColor = Color.Black;
            form.Controls.Add(picbox);
            form.ShowDialog();
        }

 

posted on 2018-10-08 09:55  蒙蒙浮霁月  阅读(194)  评论(0编辑  收藏  举报