void PrintDocument() { var doc = new PrintDoc { Landscape = true }; if (vis == null) { vis = new CatenaryGraphics(rs); } var tbl = new CatenaryTable(rs, vis.MousePosition); using (Font font = new Font(SystemFonts.DialogFont.FontFamily, 16f, FontStyle.Bold)) { doc.AddText("Catenary List", font); doc.AddHorizLine(); doc.Add(vis); doc.AddLine(); doc.Add(tbl); var dlg = new PrintPreviewAndSettings { Document = doc, StartPosition = FormStartPosition.CenterParent }; dlg.ShowDialog(); } }
private void pic_Paint(object sender, PaintEventArgs e) { if (vis == null) { this.vis = new CatenaryGraphics(rs); } vis.Render(e.Graphics, vis.GetDrawArea(pic)); }
private void catenaryPictureBox_Paint(object sender, PaintEventArgs e) { Style style = Style.Default; style.SetGraphicsQuality(e.Graphics); Vector2 min = Catenary.StartPosition, max = Catenary.EndPosition; Catenary.GetBounds(ref min, ref max); Canvas canvas = new Canvas(pictureBox.ClientRectangle, min, max); CatenaryGraphics.RenderOne(e.Graphics, canvas, Catenary, style); }