GdPicture.NET Reference Guide
GetStat Method (GdPictureImaging)
Example 





GdPicture14 Namespace > GdPictureImaging Class : GetStat Method
Returns the status of the last executed operation with the current GdPictureImaging object.
Syntax
'Declaration
 
Public Function GetStat() As GdPictureStatus
public GdPictureStatus GetStat()
public function GetStat(): GdPictureStatus; 
public function GetStat() : GdPictureStatus;
public: GdPictureStatus GetStat(); 
public:
GdPictureStatus GetStat(); 

Return Value

A member of the GdPictureStatus enumeration. If the last executed GdPictureImaging method has been successfully followed, then the return value is GdPictureStatus.OK.

We strongly recommend always checking this status first.

Remarks
Use this method in the combination with all those, which return a value instead of a status, for example all CreateGdPictureImageFrom... methods.

Please note that to identify possible printing errors you should use the PrintGetLastError method and to identify possible TWAIN errors you should use the TwainGetLastResultCode method.

Example
How to retrieve the status of the last executed method.
Dim caption As String = "Example: GetStat"
Dim oImage As GdPictureImaging = New GdPictureImaging()
Dim imageID As Integer = oImage.CreateGdPictureImageFromFile("")
If oImage.GetStat() = GdPictureStatus.OK Then
    MessageBox.Show("The image has been created successfully." + vbCrLf +
                    "The file path: " + oImage.GetLastPath() + vbCrLf + "The imageID: " + imageID, caption)
    oImage.ReleaseGdPictureImage(imageID)
Else
    MessageBox.Show("The image can't be created. Status: " + oImage.GetStat().ToString(), caption)
End If
oImage.Dispose()
string caption = "Example: GetStat";
GdPictureImaging oImage = new GdPictureImaging();
int imageID = oImage.CreateGdPictureImageFromFile("");
if (oImage.GetStat() == GdPictureStatus.OK)
{
    MessageBox.Show("The image has been created successfully.\nThe file path: " + oImage.GetLastPath() +
                    "\nThe imageID: " + imageID, caption);
    oImage.ReleaseGdPictureImage(imageID);
}
else
    MessageBox.Show("The image can't be created. Status: " + oImage.GetStat().ToString(), caption);
oImage.Dispose();
See Also

Reference

GdPictureImaging Class
GdPictureImaging Members
GetLastPath Method
PrintGetLastError Method
GetLastTransferError Method
TwainGetLastResultCode Method
TwainGetLastConditionCode Method