In This Topic
Programming / Document Loading & Saving / Loading images in general

Loading images in general

In This Topic
 Overview
You can find all currently supported document and image formats listed here.
 Load from file

The most common image location is on your filesystem.

To load an image from your disk, all you have to do is call the function GdPictureImaging.CreateGdPictureImageFromFile(), as follows:

Copy Code
Dim oGdPictureImaging As New GdPictureImaging

Dim imageID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("")
Copy Code
GdPictureImaging oGdPictureImaging = new GdPictureImaging();

int imageID = oGdPictureImaging.CreateGdPictureImageFromFile("");

As you can see above, the file location was left empty, this will prompt to show an OpenFileDialog automatically in your application. If you have a specific image to load, just enter the image file location.

Finally, please do not forget to check whether the image creation was successful. We recommend to do this by checking the returned status using the GetStat() method. As a subsequent verification, you can check, whether the returned GdPictureImage identifier does not equal 0:

Copy Code
If oGdPictureImaging.GetStat() = GdPictureStatus.OK Then

    'It stands for (imageID != 0), but feel free to check it.

    'Do your processing.

Else

    MessageBox.Show("Error: " + oGdPictureImaging.GetStat().ToString(), "Loading Example", MessageBoxButtons.OK, MessageBoxIcon.Error)

End If
Copy Code
if (oGdPictureImaging.GetStat() == GdPictureStatus.OK)

//It stands for (imageID != 0), but feel free to check it.

{

    //Do your processing.

}

else

{

    MessageBox.Show("Error: " + oGdPictureImaging.GetStat().ToString(), "Loading Example", MessageBoxButtons.OK, MessageBoxIcon.Error);

}
 Load from any other source