Example #1
0
        private void CutImage(int inIndex)
        {
            string clPath     = this.listView.Items[inIndex].SubItems[1].Text;
            Image  clImageSrc = this.mListImage[inIndex] as Image;

            FormImageCut clFormImageCut = new FormImageCut(clImageSrc, clPath);
            DialogResult enResult       = clFormImageCut.ShowDialog();

            if (enResult == DialogResult.OK)
            {
                //以下、画像切り取り処理
                CutPeace(clImageSrc, clFormImageCut.GetRectangle(), clPath);
            }
            clFormImageCut.Dispose();
            clFormImageCut = null;
        }
Example #2
0
        private void button_Cut_Click(object sender, EventArgs e)
        {
            List <int> clListIndex = ClsSystem.GetImageSelectIndex();

            if (clListIndex.Count <= 0)
            {
                return;
            }

            //以下、元画像取得処理
            int         inSelectKey   = clListIndex[0];
            ClsDatImage clDatImageSrc = ClsSystem.mDicImage[inSelectKey];

            //以下、イメージカットウィンドウ表示処理
            FormImageCut clFormImageCut = new FormImageCut(this.mFormMain, clDatImageSrc.mImgOrigin, clDatImageSrc.mPath);
            DialogResult enResult       = clFormImageCut.ShowDialog();

            if (enResult == DialogResult.OK)
            {
                int inCnt, inMax = clFormImageCut.mListCutImage.Count;
                for (inCnt = 0; inCnt < inMax; inCnt++)
                {
                    //以下、画像登録処理
                    ClsDatCutImage clDatCutImage = clFormImageCut.mListCutImage[inCnt];
                    int            inKey         = ClsSystem.CreateImageFromImage(clDatCutImage.mImage);

                    //以下、カット画像管理クラスにカット情報を登録する処理
                    ClsDatImage clDatImage = ClsSystem.mDicImage[inKey];
                    clDatImage.mPath = clDatImageSrc.mPath;
                    clDatImage.mRect = new ClsDatRect(clDatCutImage.mX, clDatCutImage.mY, clDatCutImage.mW, clDatCutImage.mH);
                }
            }
            clFormImageCut.Close();
            clFormImageCut.Dispose();
            clFormImageCut = null;

            //以下、リフレッシュ処理
            this.Refresh();
        }