コード例 #1
0
ファイル: frmBackImages.cs プロジェクト: xuanximoming/PIC
        private void Picture_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            userCtrPicture u = (userCtrPicture)sender;

            this.CurrentCtlName = u.FileName;
            this.dbClick(u);
        }
コード例 #2
0
ファイル: frmSimpleLocMap.cs プロジェクト: xuanximoming/PIC
 public void Get(userCtrPicture ctl)
 {
     this.drawArea.Initialize();
     CurrentCtl   = ctl;
     this.mImage  = (MImage)((ImgObj)ctl.ImgObj).MImage;
     this.mLocMap = (MLocationMap)((ImgObj)ctl.ImgObj).MLocationMap;
     if (this.mLocMap != null && this.mLocMap.MAP_NAME != null && this.mLocMap.MAP_NAME != "")
     {
         this.SetLocMap(this.mLocMap.MAP_NAME);
         CtlComboBox.SetDisplay(this.mLocMap.MAP_PART, this.cmb_Part);
         this.BindExplain(this.mLocMap.MAP_NAME, this.mLocMap.MAP_PART);
         CtlComboBox.SetDisplay(this.mLocMap.MAP_EXPLAIN, this.cmb_Explain);
         if (this.mLocMap.MARK_INF != null && this.mLocMap.MARK_INF != "")
         {
             read.SetPoint(this.drawArea, this.mLocMap.MARK_INF);
         }
         else
         {
             drawArea.ActiveTool = BaseControls.ImageBox.ImageCtl.DrawToolType.Point;
         }
     }
     else
     {
         this.cmb_Part.Text    = "";
         this.cmb_Explain.Text = "";
         drawArea.ActiveTool   = BaseControls.ImageBox.ImageCtl.DrawToolType.Point;
     }
     if (this.cmb_TagImage.SelectedIndex == -1)
     {
         this.cmb_TagImage.SelectedIndex = 0;
     }
 }
コード例 #3
0
        /// <summary>
        /// 图片打勾时触发
        /// </summary>
        private void Picture_CheckChanged(userCtrPicture ctr)
        {
            if (this.isInit)
            {
                return;
            }
            //userCtrPicture ctr = (userCtrPicture)sender;
            string FilePath = ctr.FilePath;

            if (!GetConfig.IsAddLocMap)
            {
                if (ctr.GetCheck())
                {
                    word.InsertImg(FilePath);
                }
                else
                {
                    word.DelImg(FilePath);
                }
            }
            else
            {
                if (ctr.GetCheck())
                {
                    word.InsertImgWithLocMap(FilePath, ctr.LocMapPath);
                }
                else
                {
                    word.DelImgWithLocMap(FilePath, ctr.LocMapPath);
                }
            }
        }
コード例 #4
0
ファイル: frmLocMap.cs プロジェクト: xuanximoming/PIC
 public void PtbDbClick(userCtrPicture ctl)
 {
     CurrentCtl            = ctl;
     this.ptb_Gather.Image = ctl.Image;
     this.Lb_ImgName.Text  = ctl.FileName;
     this.mImage           = (MImage)((ImgObj)ctl.ImgObj).MImage;
     this.mLocMap          = (MLocationMap)((ImgObj)ctl.ImgObj).MLocationMap;
     if (this.mLocMap != null && this.mLocMap.MAP_NAME != null && this.mLocMap.MAP_NAME != "")
     {
         this.SetLocMap(this.mLocMap.MAP_NAME);
         CtlComboBox.SetDisplay(this.mLocMap.MAP_PART, this.cmb_Part);
         this.BindExplain(this.mLocMap.MAP_NAME, this.mLocMap.MAP_PART);
         CtlComboBox.SetDisplay(this.mLocMap.MAP_EXPLAIN, this.cmb_Explain);
         if (this.mLocMap.MARK_INF != null && this.mLocMap.MARK_INF != "")
         {
             read.SetPoint(this.drawArea, this.mLocMap.MARK_INF);
         }
         else
         {
             drawArea.ActiveTool = BaseControls.ImageBox.ImageCtl.DrawToolType.Point;
         }
     }
     else
     {
         drawArea.ActiveTool = BaseControls.ImageBox.ImageCtl.DrawToolType.Point;
     }
 }
コード例 #5
0
ファイル: frmLocMap.cs プロジェクト: xuanximoming/PIC
 public frmLocMap(userCtrPicture ctl, WordClass word)
 {
     InitializeComponent();
     init();
     this.isRpt = true;
     this.word  = word;
     save       = new SaveImageToXml();
     read       = new ReadImageFromXML();
     this.drawArea.Initialize();
     this.PtbDbClick(ctl);
     if (this.cmb_TagImage.SelectedIndex == -1)
     {
         this.cmb_TagImage.SelectedIndex = 0;
     }
 }
コード例 #6
0
ファイル: frmRptImages.cs プロジェクト: xuanximoming/PIC
        private void Picture_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            userCtrPicture s = (userCtrPicture)sender;

            for (int i = 0; i < this.p_RptImages.Controls.Count; i++)
            {
                userCtrPictureEx u = (userCtrPictureEx)this.p_RptImages.Controls[i];
                if (u.Picture.FileName != s.FileName && u.Picture.IsSelected)
                {
                    u.Picture.IsSelected  = false;
                    u.Picture.IsSelecting = true;
                    u.Picture.Refresh();
                }
            }
            string[] ss = new string[1];
            ss[0] = s.FilePath;
            if (GetConfig.IsAddLocMap)
            {
                // if (this.frmLocMap == null || this.frmLocMap.IsDisposed)
                this.frmLocMap = new frmLocMap(s, word);
                //this.frmLocMap.init();
                this.frmLocMap.ShowDialog();
                for (int j = 0; j < this.p_RptImages.Controls.Count; j++)
                {
                    userCtrPictureEx u = (userCtrPictureEx)this.p_RptImages.Controls[j];
                    if (s.Equals(u.Picture))
                    {
                        u.l_Buttom.Text = "";
                    }
                }
            }
            else
            {
                Explorer();
                iViewer.SelectImg(ss[0]);
                //  if (iViewer == null || iViewer.IsDisposed)
                //     iViewer = new ImageViewer();
                // iViewer.init(ss);
                // iViewer.Show();
                // iViewer.Activate();
            }
        }
コード例 #7
0
ファイル: frmRptImages.cs プロジェクト: xuanximoming/PIC
        /// <summary>
        /// 删除图像
        /// </summary>
        /// <param name="DelAll">是否删除全部</param>
        public void DeleteImage(bool DelAll)
        {
            List <Control> delControl   = new List <Control>();
            List <Control> printControl = new List <Control>();
            bool           HadCheck     = false;

            if (this.p_RptImages.Controls.Count > 0)
            {
                //提示
                int delImgCount = 0;
                for (int i = 0; i < this.p_RptImages.Controls.Count; i++)
                {
                    userCtrPictureEx axf    = (userCtrPictureEx)this.p_RptImages.Controls[i];
                    ImgObj           imgobj = (ImgObj)axf.Picture.ImgObj;
                    if (axf.Picture.IsSelecting || axf.Picture.IsSelected || DelAll == true)
                    {
                        delImgCount++;
                    }
                }
                if (delImgCount > 1)
                {
                    if (DialogResult.No == MessageBoxEx.Show("已选择" + delImgCount.ToString() + "幅图片,确定删除?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information))
                    {
                        return;
                    }
                }
                //提示
                for (int i = 0; i < this.p_RptImages.Controls.Count; i++)
                {
                    try
                    {
                        userCtrPictureEx axf    = (userCtrPictureEx)this.p_RptImages.Controls[i];
                        ImgObj           imgobj = (ImgObj)axf.Picture.ImgObj;
                        if (axf.Picture.IsSelecting || axf.Picture.IsSelected || DelAll == true)
                        {
                            if (!axf.Picture.GetCheck())
                            {
                                imgobj.IsDeleted = true;
                                delControl.Add(axf);
                                if (!this.arrayImgDel.Contains(imgobj))
                                {
                                    this.arrayImgDel.Add(imgobj);
                                }
                                this.arrayImg.RemoveAt(i);
                            }
                            else
                            {
                                printControl.Add(axf);
                                HadCheck = true;
                            }
                        }
                    }
                    catch { }
                }
            }
            for (int i = 0; i < delControl.Count; i++)
            {
                this.p_RptImages.Controls.Remove(delControl[i]);
            }
            if (HadCheck)
            {
                if (DialogResult.Yes == MessageBoxEx.Show("选择图像包含打印图像,是否删除?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Information))
                {
                    for (int i = 0; i < printControl.Count; i++)
                    {
                        userCtrPicture ctr    = ((userCtrPictureEx)printControl[i]).Picture;
                        ImgObj         imgobj = (ImgObj)ctr.ImgObj;
                        imgobj.IsDeleted = true;
                        if (!this.arrayImgDel.Contains(imgobj))
                        {
                            this.arrayImgDel.Add(imgobj);
                        }
                        this.arrayImg.Remove(imgobj);
                        if (ctr.LocMapPath == "")
                        {
                            word.DelImg(ctr.FilePath);
                        }
                        else
                        {
                            word.DelImgWithLocMap(ctr.FilePath, ctr.LocMapPath);
                        }
                        this.p_RptImages.Controls.Remove(printControl[i]);
                    }
                }
            }
            this.l_Count.Text = "共 " + this.p_RptImages.Controls.Count.ToString() + " 张";
        }