private PrintPageEventArgs CreatePrintPageEvent(PageSettings pageSettings)
        {
            IntSecurity.AllPrintingAndUnmanagedCode.Assert();
            Rectangle bounds = pageSettings.GetBounds((IntPtr)this.modeHandle);

            return(new PrintPageEventArgs(null, new Rectangle(pageSettings.Margins.Left, pageSettings.Margins.Top, bounds.Width - (pageSettings.Margins.Left + pageSettings.Margins.Right), bounds.Height - (pageSettings.Margins.Top + pageSettings.Margins.Bottom)), bounds, pageSettings));
        }
Beispiel #2
0
        private PrintPageEventArgs CreatePrintPageEvent(PageSettings pageSettings)
        {
            Debug.Assert((modeHandle != null), "modeHandle is null.  Someone must have forgot to call base.StartPrint");


            Rectangle pageBounds = pageSettings.GetBounds(modeHandle);
            Rectangle marginBounds = new Rectangle(pageSettings.Margins.Left,
                                                   pageSettings.Margins.Top,
                                                   pageBounds.Width - (pageSettings.Margins.Left + pageSettings.Margins.Right),
                                                   pageBounds.Height - (pageSettings.Margins.Top + pageSettings.Margins.Bottom));

            PrintPageEventArgs pageEvent = new PrintPageEventArgs(null, marginBounds, pageBounds, pageSettings);
            return pageEvent;
        }
        private PrintPageEventArgs CreatePrintPageEvent(PageSettings pageSettings)
        {
            IntSecurity.AllPrintingAndUnmanagedCode.Assert();

            Debug.Assert(modeHandle != IntPtr.Zero, "modeHandle is null.  Someone must have forgot to call base.StartPrint");
            Rectangle pageBounds = pageSettings.GetBounds(modeHandle);

            Rectangle marginBounds = new Rectangle(pageSettings.Margins.Left,
                                                   pageSettings.Margins.Top,
                                                   pageBounds.Width - (pageSettings.Margins.Left + pageSettings.Margins.Right),
                                                   pageBounds.Height - (pageSettings.Margins.Top + pageSettings.Margins.Bottom));

            PrintPageEventArgs pageEvent = new PrintPageEventArgs(null, marginBounds, pageBounds, pageSettings);

            return(pageEvent);
        }
 private PrintPageEventArgs CreatePrintPageEvent(PageSettings pageSettings)
 {
     IntSecurity.AllPrintingAndUnmanagedCode.Assert();
     Rectangle bounds = pageSettings.GetBounds((IntPtr) this.modeHandle);
     return new PrintPageEventArgs(null, new Rectangle(pageSettings.Margins.Left, pageSettings.Margins.Top, bounds.Width - (pageSettings.Margins.Left + pageSettings.Margins.Right), bounds.Height - (pageSettings.Margins.Top + pageSettings.Margins.Bottom)), bounds, pageSettings);
 }
Beispiel #5
0
        private PrintPageEventArgs CreatePrintPageEvent(PageSettings pageSettings) {
            IntSecurity.AllPrintingAndUnmanagedCode.Assert();

            Debug.Assert((modeHandle != null), "modeHandle is null.  Someone must have forgot to call base.StartPrint");


            Rectangle pageBounds = pageSettings.GetBounds(modeHandle);
            Rectangle marginBounds = new Rectangle(pageSettings.Margins.Left, 
                                                   pageSettings.Margins.Top, 
                                                   pageBounds.Width - (pageSettings.Margins.Left + pageSettings.Margins.Right), 
                                                   pageBounds.Height - (pageSettings.Margins.Top + pageSettings.Margins.Bottom));

            PrintPageEventArgs pageEvent = new PrintPageEventArgs(null, marginBounds, pageBounds, pageSettings);
            return pageEvent;
        }