I'm trying to update my application with new version 8 of GdPicture.
When I use the method DisplayFromByteArray to load a document in GdViewer I have an errror.
I searched in new documentation and I wrote a little application with the same GdPicture example code.
Here is the code snippet, that works perfectly with the version 7.4:
Code: Select all
try
{
FileInfo fi = new FileInfo(Path.Combine(Environment.CurrentDirectory, "Tulips.jpg"));
FileStream fs = fi.OpenRead();
byte[] arr = new byte[fs.Length];
fs.Read(arr, 0, (int)fs.Length);
fs.Close();
this.GdViewer1.DisplayFromByteArray(ref arr);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
System.Diagnostics.Debug.WriteLine(ex.Message);
}
Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
With new version I have to use or call first another method?
Thanks a lot.
Michela