コード例 #1
0
ファイル: dlgImage.cs プロジェクト: infobook/Tools4
        public dlgImage(IconCollection iCol)
        {
            mCol=iCol;

            mUCIC = new ucImageCollection();
            mUCIC.pIsImageCollection = false;
            mUCIC.Dock = DockStyle.Fill;
            Controls.Add(mUCIC);

            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            _cmdCancel.Width = 0;
            _cmdCancel.Height = 0;
            _cmdCancel.SendToBack();

            if (mCol!=null)
            {
                Icon = mCol.Icon(IconCollection.Foto);

                _tb.ImageList = mCol.pImageList;
                _tbbAdd.ImageIndex = mCol.Index(IconCollection.Additive);
                _tbbDel.ImageIndex = mCol.Index(IconCollection.Minus);
                _tbbLoad.ImageIndex = mCol.Index(IconCollection.FolderOpen);
                _tbbCopy.ImageIndex = mCol.Index(IconCollection.Copy);
                _tbbPaste.ImageIndex = mCol.Index(IconCollection.Paste);
                _tbbRotateL.ImageIndex = mCol.Index(IconCollection.ImageRotate_Left);
                _tbbRotateR.ImageIndex = mCol.Index(IconCollection.ImageRotate_Right);
                _tbbFitReal.ImageIndex = mCol.Index(IconCollection.ImageFillReal);
                _tbbZoomPlus.ImageIndex = mCol.Index(IconCollection.Zoom_Plus);
                _tbbZoomMinus.ImageIndex = mCol.Index(IconCollection.Zoom_Minus);
                _tbbForward.ImageIndex = mCol.Index(IconCollection.ArrowForward);
                _tbbBackward.ImageIndex = mCol.Index(IconCollection.ArrowBackward);

                _tbbAdd.Tag = _mnuAdd;
                _tbbDel.Tag = _mnuDel;
                _tbbLoad.Tag = _mnuLoad;
                _tbbCopy.Tag = _mnuCopy;
                _tbbPaste.Tag = _mnuPaste;
                _tbbRotateL.Tag = _mnuRotateL;
                _tbbRotateR.Tag = _mnuRotateR;
                _tbbFitReal.Tag = _mnuSizeReal;
                _tbbZoomPlus.Tag = _mnuSizePlus;
                _tbbZoomMinus.Tag = _mnuSizeMinus;
                _tbbForward.Tag = _mnuForward;
                _tbbBackward.Tag = _mnuBackward;
            }
            else
                _tb.Visible = false;

            Closed += new EventHandler(dlgImage_Closed);
            ResizeRedraw = true;

            mUCIC.CollectionCurrentItemChange += new EventHandler(mUCIC_CollectionCurrentItemChange);
              mUCIC.ImageInformationChange += new EventHandler(mUCIC_ImageInformationChange);
        }