'We assume that the GdViewer1 control has been properly integrated.
If GdViewer1.DisplayFromFile("") = GdPictureStatus.OK Then
Dim imageID As Integer = GdViewer1.GetPageThumbnail(256, 256, GdViewer1.CurrentPage, GdViewer1.ARGB(255, 180, 180, 180))
If GdViewer1.GetStat() = GdPictureStatus.OK Then
Using oGdPictureImaging As GdPictureImaging = New GdPictureImaging()
If oGdPictureImaging.SaveAsPNG(imageID, "thumbnail.png") = GdPictureStatus.OK Then
MessageBox.Show("The created thumbnail has been saved successfully.", "GdViewer.ReleaseGdPictureImage")
Else
MessageBox.Show("The created thumbnail can't be saved. Status: " + oGdPictureImaging.GetStat().ToString(), "GdViewer.ReleaseGdPictureImage")
End If
End Using
GdViewer1.ReleaseGdPictureImage(imageID)
Else
MessageBox.Show("The thumbnail can't be created. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.ReleaseGdPictureImage")
End If
Else
MessageBox.Show("The file can't be loaded. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.ReleaseGdPictureImage")
End If
//We assume that the GdViewer1 control has been properly integrated.
if (GdViewer1.DisplayFromFile("") == GdPictureStatus.OK)
{
int imageID = GdViewer1.GetPageThumbnail(256, 256, GdViewer1.CurrentPage, GdViewer1.ARGB(255, 180, 180, 180));
if (GdViewer1.GetStat() == GdPictureStatus.OK)
{
using (GdPictureImaging oGdPictureImaging = new GdPictureImaging())
{
if (oGdPictureImaging.SaveAsPNG(imageID, "thumbnail.png") == GdPictureStatus.OK)
MessageBox.Show("The created thumbnail has been saved successfully.", "GdViewer.ReleaseGdPictureImage");
else
MessageBox.Show("The created thumbnail can't be saved. Status: " + oGdPictureImaging.GetStat().ToString(), "GdViewer.ReleaseGdPictureImage");
}
GdViewer1.ReleaseGdPictureImage(imageID);
}
else
MessageBox.Show("The thumbnail can't be created. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.ReleaseGdPictureImage");
}
else
MessageBox.Show("The file can't be loaded. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.ReleaseGdPictureImage");