public void handleCutouts(int mode) { Bitmap bmp = null; if (Properties.Settings.Default.s_hasDelay) { } else { } bmp = doCutting(mode); if (mode == -1) { if (bmp != null) { Clipboard.SetImage(bmp); } } else { int i = 0; var x = Application.OpenForms; foreach (Form f in x) { if (f is f_Screen) { i++; break; } } if (i == 0) { f_EditorScreen = new f_Screen { parent = this }; f_EditorScreen.Show(); f_EditorScreen.Refresh(); if (Properties.Settings.Default.s_ToolbarPanel == 0) { tools = new f_ToolsPanel { parent = f_EditorScreen }; f_EditorScreen.child = tools; tools.Show(); } } if (f_EditorScreen != null) { f_EditorScreen.addImage(bmp, lastCutoutId); lastCutoutId = ""; } } }
private void btn_Screen_Click(object sender, EventArgs e) { if (f_EditorScreen != null && !f_EditorScreen.IsDisposed) { f_EditorScreen.WindowState = FormWindowState.Normal; f_EditorScreen.BringToFront(); f_EditorScreen.Focus(); } else { f_EditorScreen = new f_Screen { parent = this }; } f_EditorScreen.Show(); if (Properties.Settings.Default.s_ToolbarPanel == 0) { if (tools == null || tools.IsDisposed) { tools = new f_ToolsPanel(); } f_EditorScreen.child = tools; tools.parent = f_EditorScreen; tools.Show(); } }
public static Bitmap createPng(f_Screen fs, List <c_ImageHolder> cutouts, Object[] drawings, bool drawTBG) { if (fs != null) { int left = int.MaxValue; int top = int.MaxValue; int right = 0; int bottom = 0; foreach (var v in cutouts) { //var k = v.Value; if (v.Left < left) { left = v.Left; } if (v.Top < top) { top = v.Top; } if (v.Left + v.Width > right) { right = v.Left + v.Width; } if (v.Top + v.Height > bottom) { bottom = v.Top + v.Height; } } int height = bottom - top; int width = right - left; var picrec = new System.Drawing.Rectangle(left, top, width, height); Bitmap _b = createImage(picrec, cutouts, drawTBG); return(_b); } else { return(null); } }
public c_ImageHolder(string cid, f_Screen _parent) { parent = _parent; backup_id = cid; SetupButtons(); if (backup_id == "EDITLAYER") { stayOnTop = true; visible = false; } else { stayOnTop = false; visible = true; } }
public void refreshImage(f_Screen fs) { pb_PreviewPicture.Image = c_ImgGen.createPng(fs, fs.Limages, new object[] { fs.getDrawnPoints(), null }); GC.Collect(1); }
public static Bitmap createPng(f_Screen fs, List <c_ImageHolder> cutouts, Object[] drawings) { return(createPng(fs, cutouts, drawings, false)); }