PrintPageEventArgs.Graphics Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets the Graphics used to paint the page.

Namespace:   System.Drawing.Printing
Assembly:  System.Drawing (in System.Drawing.dll)

member Graphics : Graphics with get

Property Value

Type: System.Drawing.Graphics

The Graphics used to paint the page.

The following code example assumes a Button named printButton and a PrintDocument named pd have been created on a Form. Make sure the Click event for the Button is associated with the printButton_Click method and the PrintPage event of the PrintDocument is associated with the pd_PrintPage method in the example. The printButton_Click method from the example calls the Print method raising the PrintPage event, and prints the .bmp file specified in the pd_PrintPage method. To run this example, change the path to the bitmap you want to print.

Use the System.Drawing, System.Drawing.Printing, and System.Windows.Forms namespaces for this example.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: