コード例 #1
0
ファイル: Paper.cs プロジェクト: wangGuangXu/Winfroms
        public void AddGraphics(EasyPhoto.GraphicsType type, Image image, Point point, int width, int height)
        {
            CustomClass.Cell newCell = new EasyPhoto.CustomClass.Cell(type, image, point, width, height);
            arrayList.Add(newCell);
            Graphics backg = Graphics.FromImage(backImage);

            newCell.CellPaint(backg);
            this.OnPaint(null);
            //this.Parent.Invalidate();
        }
コード例 #2
0
ファイル: Paper.cs プロジェクト: wangGuangXu/Winfroms
        public void AddGraphics(GraphicsType type, System.Collections.ArrayList arraylist)
        {
            CustomClass.Cell newCell = new EasyPhoto.CustomClass.Cell(type, this.baseImage, arraylist);
            this.arrayList.Add(newCell);
            Graphics backg = Graphics.FromImage(backImage);

            newCell.CellPaint(backg);
            this.OnPaint(null);
            //this.Parent.Invalidate();
        }
コード例 #3
0
ファイル: Paper.cs プロジェクト: wangGuangXu/Winfroms
        public void AddGraphics(EasyPhoto.GraphicsType type, string str, Font font, Brush brush, Point p)
        {
            CustomClass.Cell newCell = new EasyPhoto.CustomClass.Cell(type, str, font, brush, p);
            arrayList.Add(newCell);
            Graphics backg = Graphics.FromImage(backImage);

            newCell.CellPaint(backg);
            this.OnPaint(null);
            //this.Parent.Invalidate();
        }
コード例 #4
0
ファイル: MainForm.cs プロジェクト: wangGuangXu/Winfroms
        private void MainForm_Load(object sender, EventArgs e)
        {
            EasyPhoto.FileInfo fileinfo = new FileInfo(".hdk", Application.StartupPath + @"\EasyPhoto.ico", "EasyPhoto文件", Application.StartupPath + @"\EasyPhoto.exe");
            EasyPhoto.FileTypeRegister.RegisterFileType(fileinfo);
            if (MainForm.DefaultPath != "")
            {
                string temp = (string)MainForm.DefaultPath.Clone();
                MainForm.DefaultPath = "";
                this.LoadFile(temp);
                return;
            }

            this.mainTabControl.Visible = false;

            this.DrawClientWidth  = this.ClientSize.Width - this.mainToolStrip.Width - this.imageTabControl.Width - 8;
            this.DrawClientHeight = this.ClientSize.Height - this.mainMenuStrip.Height - this.mainStatusStrip.Height - 5;

            //工具栏各工具的初始化
            this.mainTabControl.Visible = false;
            this.treeView1.Visible      = false;
            this.CurrentPen             = new Pen(new SolidBrush(Color.Black));
            this.TempPen      = (Pen)this.CurrentPen.Clone();
            TempPen.DashStyle = System.Drawing.Drawing2D.DashStyle.DashDot;
            this.CurrentBrush = new SolidBrush(Color.Black);
            this.UpdateFont(new FontFamily("宋体"), 12, FontStyle.Regular);
            this.toolSelected             = ToolSelected.None;
            this.currentMouseDownPosition = new Point();
            this.currentgraphics          = null;
            this.BrushRadius   = 1;
            this.IsMouseClick  = false;
            this.IsMouseDown   = false;
            this.IsCopyCell    = false;
            this.IsCopyLayer   = false;
            this.TempCell      = null;
            this.TempLayer     = null;
            this.Zoom          = 1;
            defaultTabPageName = "图层";
            currentPaper       = null;
            defaultTabPageNum  = 0;
            this.paperName     = "";
            this.CurrentStage  = null;
            this.LayerArrayList.Clear();
            this.tempArrayList.Clear();
            this.finalArrayList.Clear();
            try
            {
                HandCursor      = new Cursor(Application.StartupPath + @"\Resources\Hand.cur");
                PencilCursor    = new Cursor(Application.StartupPath + @"\Resources\Pencil.cur");
                MagnifierCursor = new Cursor(Application.StartupPath + @"\Resources\Magnifier.cur");
                EraserCursor    = new Cursor(Application.StartupPath + @"\Resources\Eraser.cur");
                BrushCursor     = new Cursor(Application.StartupPath + @"\Resources\Brush.cur");
            }
            catch (Exception e1)
            {
                MessageBox.Show(e1.Message, "图标加载失败");
                HandCursor      = Cursors.Default;
                PencilCursor    = Cursors.Default;
                MagnifierCursor = Cursors.Default;
                EraserCursor    = Cursors.Default;
                BrushCursor     = Cursors.Default;
            }

            this.CheckLayerInformaiton();
        }