'We assume that the GdViewer1 control has been properly integrated.
Using oGdPictureImaging As GdPictureImaging = New GdPictureImaging()
'The File Open dialog box will pop up to select a file.
Dim imageID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("")
If oGdPictureImaging.GetStat() = GdPictureStatus.OK Then
Dim fileString As String = oGdPictureImaging.Encode64String(oGdPictureImaging.SaveAsString(imageID, GdPicture14.DocumentFormat.DocumentFormatTIFF, 65536))
oGdPictureImaging.ReleaseGdPictureImage(imageID)
If oGdPictureImaging.GetStat() = GdPictureStatus.OK Then
If GdViewer1.DisplayFromString(oGdPictureImaging.Decode64String(fileString)) = GdPictureStatus.OK Then
'Do your stuff here.
Else
MessageBox.Show("This file can't be displayed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.DisplayFromString")
End If
Else
MessageBox.Show("This file can't be transformed. Status: " + oGdPictureImaging.GetStat().ToString(), "GdViewer.DisplayFromString")
End If
Else
MessageBox.Show("This file can't be loaded. Status: " + oGdPictureImaging.GetStat().ToString(), "GdViewer.DisplayFromString")
End If
End Using
//We assume that the GdViewer1 control has been properly integrated.
using (GdPictureImaging oGdPictureImaging = new GdPictureImaging())
{
//The File Open dialog box will pop up to select a file.
int imageID = oGdPictureImaging.CreateGdPictureImageFromFile("");
if (oGdPictureImaging.GetStat() == GdPictureStatus.OK)
{
string fileString = oGdPictureImaging.Encode64String(oGdPictureImaging.SaveAsString(imageID, GdPicture14.DocumentFormat.DocumentFormatTIFF, 65536));
oGdPictureImaging.ReleaseGdPictureImage(imageID);
if (oGdPictureImaging.GetStat() == GdPictureStatus.OK)
{
if (GdViewer1.DisplayFromString(oGdPictureImaging.Decode64String(fileString)) == GdPictureStatus.OK)
{
//Do your stuff here.
}
else
MessageBox.Show("This file can't be displayed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.DisplayFromString");
}
else
MessageBox.Show("This file can't be transformed. Status: " + oGdPictureImaging.GetStat().ToString(), "GdViewer.DisplayFromString");
}
else
MessageBox.Show("This file can't be loaded. Status: " + oGdPictureImaging.GetStat().ToString(), "GdViewer.DisplayFromString");
}