public LayerCase(EasyPhoto.EPControl.Layer temp) { this.backgroundColor = temp.BackgroundColor; this.backgroundHeight = temp.BackgroundHeight; this.backgroundWidth = temp.BackgroundWidth; this.size = temp.Size; this.paperName = temp.PaperName; this.startPoint = temp.StartPosition; this.activeNum = temp.ActiveNum; this.backPaperColor = ((SolidBrush)temp.BackPaperColor).Color; this.showRectangle = temp.showRectangle; this.baseImage = (System.Drawing.Bitmap)temp.baseImage.Clone(); this.backImage = temp.BackImage; this.finalImage = temp.FinalImage; this.tempCell = temp.GetTempCell; this.zoom = temp.Zoom; this.arrayList = temp.GetArrayList(); this.Cansee = temp.CanSee; }
public void LoadPaper(SerialClass serialclass) { if (serialclass == null) { MessageBox.Show("加载文件失败!", "提示"); return; } else { while (this.mainTabControl.Controls.Count > 1) { this.mainTabControl.Controls.RemoveAt(1); } this.baseTabPage.Controls.Clear(); this.MainForm_Load(this, null); foreach (ToolStripButton tsbutton in this.mainToolStrip.Items) { tsbutton.CheckState = CheckState.Unchecked; } this.defaultTabPageNum = serialclass.defaultlyaernamenum; this.CurrentStage = new EasyPhoto.EPControl.Stage(serialclass.SerialStage, this); this.baseTabPage.Controls.Add(CurrentStage); this.baseTabPage.Text = CurrentStage.PaperName; this.currentPaper = CurrentStage; if (serialclass.SerialLayers != null) { for (int i = 0; i < serialclass.SerialLayers.Length; i++) { EasyPhoto.EPControl.Layer temp = new EasyPhoto.EPControl.Layer(serialclass.SerialLayers[i], this); this.LayerArrayList.Add(temp); } } this.mainTabControl.Visible = true; this.CheckLayerInformaiton(); } }
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(); }