Exemple #1
0
        public void ReLoadImg(MWorkList MworkList)
        {
            ImageCopy imgCopy = new ImageCopy();

            MworkList.REPORT_STATUS = 1;
            this.arrayImg           = imgCopy.LoadImages(MworkList, Dir);
            LoadImages(this.arrayImg, false, this.ReadOnly);
            //frmMainForm.examInf.
        }
Exemple #2
0
        public void Save()
        {
            if (this.mImage == null)
            {
                return;
            }
            Bitmap b = null, bt = null, btp = null;

            try
            {
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }
                FileOperator ope         = new FileOperator();
                string       newFileName = "Map" + this.CurrentCtl.FileName.Replace("Mark", "");
                string       Newpath     = path + newFileName;
                b   = ImageOpe.FromGraphics((Control)drawArea, drawArea.Width - 2, drawArea.Height - 2);
                bt  = ImageOpe.KiResizeImage(b, 2 * GetConfig.RS_LocMapWidth, 2 * GetConfig.RS_LocMapHeight, 0);
                btp = DrawString(bt, this.cmb_Part.Text.Trim(), this.cmb_Explain.Text.Trim());
                btp.Save(Newpath);
                if (this.mLocMap == null)
                {
                    this.mLocMap               = new MLocationMap();
                    mLocMap.MAP_ID             = this.mImage.IMAGE_ID;
                    mLocMap.EXAM_ACCESSION_NUM = this.mImage.EXAM_ACCESSION_NUM;
                }
                mLocMap.MAP_PART      = this.cmb_Part.Text.Trim();
                mLocMap.MAP_EXPLAIN   = this.cmb_Explain.Text.Trim();
                mLocMap.MAP_TIME      = System.DateTime.Now;
                mLocMap.MARK_INF      = save.SavePoint(this.drawArea);
                mLocMap.MAP_NAME      = LocalMapName;
                mLocMap.MAP_PATH      = this.mImage.IMAGE_PATH.Substring(0, this.mImage.IMAGE_PATH.LastIndexOf("/") + 1) + newFileName;
                CurrentCtl.LocMapPath = Newpath;
                int       i  = 0;
                ImageCopy ic = new ImageCopy();
                i = ic.FileUpLoad(mLocMap, Newpath);
                if (i < 0)
                {
                    MessageBoxEx.Show("±£´æʧ°Ü£¡", "¾¯¸æ");
                }
                else
                {
                    ((ImgObj)CurrentCtl.ImgObj).MLocationMap = mLocMap;
                }
            }
            catch { MessageBoxEx.Show("±£´æʧ°Ü£¡", "¾¯¸æ"); }
            finally
            {
                b.Dispose();
                bt.Dispose();
                btp.Dispose();
            }
        }
Exemple #3
0
        private ImgObj AddImgObj(string newFileName, string path)
        {
            SIS_Model.MImage Mimage = new SIS_Model.MImage();
            Mimage.EXAM_ACCESSION_NUM = frmMainForm.examInf.ExamAccessionNum;
            Mimage.IMAGE_PATH         = GetConfig.ServerImgDir + "/" + frmMainForm.examInf.ReqDateTime + "/" + frmMainForm.examInf.ExamAccessionNum + "/" + newFileName;//linux上文件保存路径
            ImageCopy imgCopy = new ImageCopy();

            if (imgCopy.FileUpLoad(Mimage, path, false) != 1)
            {
                return(null);
            }
            ImgObj imgObj = new ImgObj(path, false, Mimage);

            frmMainForm.examInf.ArrayImages.Add(imgObj);
            this.arrayImg.Add(imgObj);
            return(imgObj);
        }
Exemple #4
0
        private void dgv_Study_Click(object sender, EventArgs e)
        {
            if (dgv_Study.SelectedRows.Count <= 0)
            {
                return;
            }
            string ExamAccessionNum = dgv_Study.SelectedRows[0].Cells["EXAM_ACCESSION_NUM"].Value.ToString().Trim();

            if (!Directory.Exists(TemDir))
            {
                Directory.CreateDirectory(TemDir);
            }
            imgCopy      = new ImageCopy();
            this.mStudy  = (SIS_Model.MStudy)bs.GetModel(ExamAccessionNum);
            this.mReport = imgCopy.PacsReportDownLoad(this.mStudy, TemDir);
            this.Path    = TemDir + "\\" + ExamAccessionNum + ".doc";
            this.gb_HistoryRptInfo.Visible = false;
        }
Exemple #5
0
        private void dgv_Study_Click(object sender, EventArgs e)
        {
            if (dgv_Study.SelectedRows.Count <= 0)
            {
                return;
            }
            string ExamAccessionNum = dgv_Study.SelectedRows[0].Cells["EXAM_ACCESSION_NUM"].Value.ToString().Trim();

            if (!Directory.Exists(CacheDir))
            {
                Directory.CreateDirectory(CacheDir);
            }
            imgCopy      = new ImageCopy();
            this.mStudy  = (SIS_Model.MStudy)bStudy.GetModel(ExamAccessionNum);
            this.mReport = imgCopy.PacsReportDownLoad(this.mStudy, CacheDir);
            this.Path    = CacheDir + "\\" + ExamAccessionNum + ".doc";
            this.txt_Description.Text = "检查所见:" + Environment.NewLine + dgv_Study.SelectedRows[0].Cells["DESCRIPTION"].Value.ToString();
            this.txt_Impression.Text  = "诊断意见:" + Environment.NewLine + dgv_Study.SelectedRows[0].Cells["IMPRESSION"].Value.ToString();
        }
Exemple #6
0
        private void btn_Save_Click(object sender, EventArgs e)
        {
            if (this.mImage == null)
            {
                return;
            }
            Bitmap b = null, bt = null, btp = null;

            try
            {
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }
                FileOperator ope         = new FileOperator();
                string       newFileName = "Map" + this.Lb_ImgName.Text;
                string       Newpath     = path + newFileName;
                b   = ImageOpe.FromGraphics((Control)drawArea, drawArea.Width - 2, drawArea.Height - 2);
                bt  = ImageOpe.KiResizeImage(b, 2 * GetConfig.RS_LocMapWidth, 2 * GetConfig.RS_LocMapHeight, 0);
                btp = DrawString(bt, this.cmb_Part.Text.Trim(), this.cmb_Explain.Text.Trim());
                btp.Save(Newpath);
                if (this.mLocMap == null)
                {
                    this.mLocMap               = new MLocationMap();
                    mLocMap.MAP_ID             = this.mImage.IMAGE_ID;
                    mLocMap.EXAM_ACCESSION_NUM = this.mImage.EXAM_ACCESSION_NUM;
                }
                mLocMap.MAP_PART    = this.cmb_Part.Text.Trim();
                mLocMap.MAP_EXPLAIN = this.cmb_Explain.Text.Trim();
                mLocMap.MAP_TIME    = System.DateTime.Now;
                mLocMap.MARK_INF    = save.SavePoint(this.drawArea);
                mLocMap.MAP_NAME    = LocalMapName;
                mLocMap.MAP_PATH    = this.mImage.IMAGE_PATH.Substring(0, this.mImage.IMAGE_PATH.LastIndexOf("/") + 1) + newFileName;
                ((ImgObj)CurrentCtl.ImgObj).MLocationMap = (object)mLocMap;
                CurrentCtl.LocMapPath = Newpath;
                int       i  = 0;
                ImageCopy ic = new ImageCopy();
                i = ic.FileUpLoad(mLocMap, Newpath);
                if (i < 0)
                {
                    MessageBoxEx.Show("保存失败!", "警告");
                }
                if (this.isRpt)
                {
                    ((ImgObj)CurrentCtl.ImgObj).MLocationMap = mLocMap;
                    if (!this.CurrentCtl.GetCheck())
                    {
                        this.CurrentCtl.SetCheck(true);
                    }
                    else
                    {
                        this.word.PasteImgWithLocMap(this.CurrentCtl.FilePath, this.CurrentCtl.LocMapPath);
                    }
                    this.Close();
                }
            }
            catch { MessageBoxEx.Show("保存失败!", "警告"); }
            finally
            {
                b.Dispose();
                bt.Dispose();
                btp.Dispose();
            }
        }
Exemple #7
0
 private void DeleteImg(bool isAll)
 {
     if (this.p_PreferImages.Controls.Count > 0)
     {
         List <userCtrPictureEx> arrayDelCheckCtl = new List <userCtrPictureEx>();
         List <userCtrPictureEx> arrayDelCtl      = new List <userCtrPictureEx>();
         for (int i = 0; i < this.p_PreferImages.Controls.Count; i++)
         {
             userCtrPictureEx axf = (userCtrPictureEx)this.p_PreferImages.Controls[i];
             if (isAll)
             {
                 arrayDelCtl.Add(axf);
                 continue;
             }
             if (axf.Picture.IsSelecting)
             {
                 if (axf.Picture.GetCheck())
                 {
                     arrayDelCheckCtl.Add(axf);
                 }
                 else
                 {
                     arrayDelCtl.Add(axf);
                 }
             }
         }
         if (!isAll && arrayDelCtl.Count == 0 && arrayDelCheckCtl.Count == 0)
         {
             return;
         }
         DialogResult dr;
         if (arrayDelCheckCtl.Count > 0)
         {
             if (!isAll)
             {
                 dr = MessageBoxEx.Show("选择图像包含打印图像,打印图像不能删除,是否删除其它所选择图像?", "警告", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
             }
             else
             {
                 dr = MessageBoxEx.Show("该检查包含打印图像,打印图像不能删除,是否删除所有没打印图像?", "警告", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
             }
         }
         else
         {
             if (!isAll)
             {
                 dr = MessageBoxEx.Show("是否删除所选择图像?", "警告", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
             }
             else
             {
                 dr = MessageBoxEx.Show("是否删除该检查所有图像?", "警告", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
             }
         }
         if (dr == DialogResult.OK)
         {
             ImageCopy imgCopy = new ImageCopy();
             if (isAll)
             {
                 for (int i = 0; i < arrayDelCtl.Count; i++)
                 {
                     System.IO.File.Delete(arrayDelCtl[i].Picture.FilePath);
                     ImgObj obj = (ImgObj)arrayDelCtl[i].Picture.ImgObj;
                     imgCopy.DeleteImg((SIS_Model.MImage)obj.MImage);
                 }
                 this.p_PreferImages.Controls.Clear();
                 this.dbClick(null);
                 frmMainForm.examInf.ArrayImages.Clear();
             }
             else
             {
                 for (int i = 0; i < arrayDelCtl.Count; i++)
                 {
                     System.IO.File.Delete(arrayDelCtl[i].Picture.FilePath);
                     this.p_PreferImages.Controls.Remove(arrayDelCtl[i]);
                     ImgObj obj = (ImgObj)arrayDelCtl[i].Picture.ImgObj;
                     imgCopy.DeleteImg((SIS_Model.MImage)obj.MImage);
                     frmMainForm.examInf.ArrayImages.Remove(obj);
                     if (obj.ImagePath.Substring(obj.ImagePath.LastIndexOf("\\") + 1) == this.CurrentCtlName)
                     {
                         this.dbClick(null);
                     }
                 }
             }
         }
     }
     this.l_Count.Text = "共 " + this.p_PreferImages.Controls.Count.ToString() + " 张";
 }
Exemple #8
0
        /// <summary>
        /// 保存图像处理后的效果
        /// </summary>
        /// <param name="image">新图像</param>
        /// <param name="Obj">图像数据库对象</param>
        /// <param name="xml">处理信息</param>
        /// <param name="name">旧图像名</param>
        /// <returns>是否保存成功</returns>
        public bool SaveMark(Image image, ImgObj Obj, string xml, ref string name)
        {
            if (!Directory.Exists(Dir))
            {
                Directory.CreateDirectory(Dir);
            }
            MImage img = (MImage)Obj.MImage;

            if (xml == "" && name.Contains("Mark"))
            {
                img.MARK_IMAGE_PATH = "";
                img.MARK_INF        = "";
                SIS_BLL.BImage bi = new SIS_BLL.BImage();
                if (bi.Update(img, " where IMAGE_ID = " + img.IMAGE_ID) < 0)
                {
                    return(false);
                }
                else
                {
                    Obj.MarkImgPath = "";
                    Obj.MarkInf     = "";
                    name            = name.Replace("Mark", "");
                    string           newpath = Dir + "\\" + name;
                    userCtrPictureEx u       = (userCtrPictureEx)this.p_PreferImages.Controls[name];
                    u.Picture.LoadFile(newpath);
                    u.Picture.IsMark    = false;
                    u.l_Buttom.Text     = name;
                    this.CurrentCtlName = u.Picture.FileName;
                    this.dbClick(u.Picture);
                    return(true);
                }
            }
            else
            {
                string newPath = "";
                string oldName = name;
                if (xml != "" && !name.Contains("Mark"))
                {
                    name                = "Mark" + name;
                    newPath             = Dir + "\\" + name;
                    img.MARK_IMAGE_PATH = GetConfig.ServerImgDir + "/" + frmMainForm.examInf.ReqDateTime + "/" + frmMainForm.examInf.ExamAccessionNum + "/" + name;
                }
                else
                {
                    newPath = Obj.MarkImgPath;
                    oldName = name.Replace("Mark", "");
                }
                image.Save(newPath);
                img.MARK_INF = xml;
                ImageCopy imgCopy = new ImageCopy();
                if (imgCopy.FileUpLoad(img, newPath, true) != 1)
                {
                    return(false);
                }
                else
                {
                    Obj.MarkImgPath = newPath;
                    Obj.MarkInf     = xml;
                    userCtrPictureEx u = (userCtrPictureEx)this.p_PreferImages.Controls[oldName];
                    u.Picture.LoadFile(newPath);
                    u.Picture.IsMark    = true;
                    u.l_Buttom.Text     = name;
                    this.CurrentCtlName = u.Picture.FileName;
                    this.dbClick(u.Picture);
                    return(true);
                }
            }
        }