Пример #1
0
        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();
            }
        }
Пример #2
0
        private void printButton_Click(object sender, EventArgs e)
        {
            var img = new Bitmap(Size.Width, Size.Height);

            this.DrawToBitmap(img, new Rectangle(Point.Empty, Size));
            var doc  = new PrintDoc();
            var draw = new Picture(img)
            {
                FitToPage = true, Caption = "Tension Properties"
            };

            doc.Add(draw);
            var dlg = new PrintPreviewAndSettings
            {
                Document      = doc,
                StartPosition = FormStartPosition.CenterParent
            };

            dlg.ShowDialog();
        }