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);
}