GdPicture.NET.14
GdPicture14 Namespace / GdPictureImaging Class / PrintDialog Method / PrintDialog(Int32,IWin32Window) Method
A unique image identifier of the GdPicture image representing the image in use.
Represents the top-level window that will own the modal dialog box.
Example





In This Topic
PrintDialog(Int32,IWin32Window) 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 ImageID As Integer, _
   ByVal owner As IWin32Window _
) As Boolean
public bool PrintDialog( 
   int ImageID,
   IWin32Window owner
)
public function PrintDialog( 
    ImageID: Integer;
    owner: IWin32Window
): Boolean; 
public function PrintDialog( 
   ImageID : int,
   owner : IWin32Window
) : boolean;
public: bool PrintDialog( 
   int ImageID,
   IWin32Window* owner
) 
public:
bool PrintDialog( 
   int ImageID,
   IWin32Window^ owner
) 

Parameters

ImageID
A unique image identifier of the GdPicture image representing the image in use.
owner
Represents the top-level window that will own the modal dialog box.

Return Value

true if the method has been followed successfully, otherwise false. Please use the 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, this);
 
    // 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, this) == 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