I checked on the hard disk the animated gif is created and i opened it in internet explorer and it worked.
So i dont understand why im getting this white with big x red.
I used breakpoint and didnt get any errors so far.
The real creation of the animated gif in this class is this line number 175:
unfreez.MakeGIF(myGifList, previewFileName, 8, true);
And the animated gif is realy exist and created.In line 210 im calling the function that load the animated gif to the pictureBox:
pictureBoxImage(previewFileName);
And this is the pictureBoxImage function where i used breakpoint and it didnt show any errors:
public void pictureBoxImage(string pbImage)
{
Image img2 = null;
try
{
using (img = Image.FromFile(pbImage))
{
//get the old image thats loaded from the _memSt memorystream
//and dispose it
Image i = this.pictureBox1.Image;
this.pictureBox1.Image = null;
if (i != null)
i.Dispose();
//grab the old stream
MemoryStream m = _memSt;
//save the new image to this stream
_memSt = new MemoryStream();
img.Save(_memSt, System.Drawing.Imaging.ImageFormat.Gif);
if (m != null)
m.Dispose();
//create our image to display
img2 = Image.FromStream(_memSt);
}
if (img2 != null)
pictureBox1.Image = img2;
//label2.Text = numberOfFiles.ToString();
//label6.Text = nameOfStartFile.ToString();
//label4.Text = nameOfEndFile.ToString();
//File.Delete(pbImage);
}
catch (Exception err)
{
Logger.Write("Animation Error >>> " + err);
}
}
Cant figure out why ? The red x and white background.
I didnt copy to here the whole class but i will if its needed but the animated gif is created good and working on internet explorer so the class is working but the showing on the pictureBox dosent work for some reason.