PrintDialog(Int32) Method
 
            
                In This Topic
            
            Invokes the standard Windows Print dialog box, which allows you to select additional options or settings and then to print the specified GdPicture image.
            This method uses the actual paper size when printing.
            
            
            Syntax
            
            
            
            
            'Declaration
 
Public Overloads Function PrintDialog( _
   ByVal  As Integer _
) As Boolean
             
        
            
            public bool PrintDialog( 
   int 
)
             
        
            
            public function PrintDialog( 
    : Integer
): Boolean; 
             
        
            
            public function PrintDialog( 
    : int
) : boolean;
             
        
            
            public: bool PrintDialog( 
   int 
) 
             
        
            
            public:
bool PrintDialog( 
   int 
) 
             
        
             
        
            Parameters
- ImageID
 
- A unique image identifier of the GdPicture image representing the image in use.
 
            
            Return Value
true if the method has been followed successfully, otherwise false. Please use the 
GdPictureImaging.PrintGetStat method to determine the reason for the printing failure.
 
            
            
            
            
            
            Example
Printing an image.
            
             
Printing an image with the help of standard Windows Printer Dialog.
    
	
		using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    // Open an image file. An empty string allows the control to prompt for selecting a file.
    int imageID = gdpictureImaging.CreateGdPictureImageFromFile("");
 
    gdpictureImaging.PrintDialog(imageID);
 
    // Release used resources.
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
	 
	
 
Showing the error description of the last executed print operation, that has failed.
    
	
		using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    // Open an image file. An empty string allows the control to prompt for selecting a file.
    int imageID = gdpictureImaging.CreateGdPictureImageFromFile("");
 
    if (gdpictureImaging.PrintDialog(imageID) == false)
    {
        MessageBox.Show("Printing failed for " + gdpictureImaging.PrintGetDocumentName() +
                        "\nError: " + gdpictureImaging.PrintGetStat() +
                        "\nMessage: " + gdpictureImaging.PrintGetLastError(), "Printing status", MessageBoxButtons.OK, MessageBoxIcon.Error);
    }
    else
        MessageBox.Show("Printing succeded for " + gdpictureImaging.PrintGetDocumentName(), "Printing status", MessageBoxButtons.OK, MessageBoxIcon.Information);
 
    // Release used resources.
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
	 
	
 
 
            
            Example
Printing an image.
            
            using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
            {
                // Open an image file. An empty string allows the control to prompt for selecting a file.
                int imageID = gdpictureImaging.CreateGdPictureImageFromFile("");
             
                gdpictureImaging.PrintDialog(imageID);
             
                // Release used resources.
                gdpictureImaging.ReleaseGdPictureImage(imageID);
            }
            using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
            {
                // Open an image file. An empty string allows the control to prompt for selecting a file.
                int imageID = gdpictureImaging.CreateGdPictureImageFromFile("");
             
                if (gdpictureImaging.PrintDialog(imageID) == false)
                {
                    MessageBox.Show("Printing failed for " + gdpictureImaging.PrintGetDocumentName() +
                                    "\nError: " + gdpictureImaging.PrintGetStat() +
                                    "\nMessage: " + gdpictureImaging.PrintGetLastError(), "Printing status", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                    MessageBox.Show("Printing succeded for " + gdpictureImaging.PrintGetDocumentName(), "Printing status", MessageBoxButtons.OK, MessageBoxIcon.Information);
             
                // Release used resources.
                gdpictureImaging.ReleaseGdPictureImage(imageID);
            }
            
            
            See Also