Issue set delay Frame in Convert to .gif

Questions, comments and suggestions concerning VintaSoft Imaging .NET SDK.

Moderator: Alex

Post Reply
dovanmy211
Posts: 5
Joined: Mon Mar 11, 2013 5:51 am

Issue set delay Frame in Convert to .gif

Post by dovanmy211 » Mon Mar 11, 2013 7:00 am

Hello !
I'm having issue set page delay in converting to gif. I set 30 image play / 1s and loop 10 . total time play = 1000 . 1s = 100 => A page delay = 3.333333333333333.
I using property NewFileGif.Pages.Delay but type data int only receive 3.
=> total time play 30 page 30 x 3 = 90 loop 10. total time play 10 x 90= 900. SDK support set 1000/1s ?

I'm using version 6.1 from your application.

Thanks in advance!
Best regards,

Alex
Site Admin
Posts: 1524
Joined: Thu Jul 10, 2008 2:21 pm

Re: Issue set delay Frame in Convert to .gif

Post by Alex » Mon Mar 11, 2013 8:31 am

Hello,

Delay between GIF frames can be specified in 1/100 of second.

In your case you can go 2 ways:
  • Use 30 frames and 3/100 second as delay between GIF frames
  • Use 25 frames and 4/100 second as delay between GIF frames
Best regards, Alexander

dovanmy211
Posts: 5
Joined: Mon Mar 11, 2013 5:51 am

Re: Issue set delay Frame in Convert to .gif

Post by dovanmy211 » Mon Mar 11, 2013 10:34 am

Hello,
Thanks for answering my question. You can help me check source are correct ?
Thanks in advance!
Best regards,
My Source :

Code: Select all

GifFile NewFileGif = new GifFile(1980, 1020);
int delayImage = 100 / 30;  // Time 1s / 30 image = Time delay a Image
int loopMovie = 10; // Loop Gif
for (int i = 0; i < loopMovie; i++) // loop 10
{
    for (int a = 0; a < 30; a++) // Add 30 Image 
    {
         VintasoftImage imgobj = new VintasoftImage(this.ListContens[0].ListPath[a].ToString());
         NewFileGif.Pages.Add(imgobj);
         NewFileGif.Pages[a].Delay = delayImage;
         imgobj.Dispose();
    }
}

NewFileGif.Save(this.ListContens[0].PathMovieOutput);
NewFileGif.Dispose();

Alex
Site Admin
Posts: 1524
Joined: Thu Jul 10, 2008 2:21 pm

Re: Issue set delay Frame in Convert to .gif

Post by Alex » Mon Mar 11, 2013 1:07 pm

Hello,

Your code is not optimal, here is better code:

Code: Select all

GifFile NewFileGif = new GifFile(1980, 1020);

int delayImage = 100 / 30;  // Time 1s / 30 image = Time delay a Image
for (int a = 0; a < 30; a++) // Add 30 Image 
{
     VintasoftImage imgobj = new VintasoftImage(this.ListContens[0].ListPath[a].ToString());
     NewFileGif.Pages.Add(imgobj);
     NewFileGif.Pages[a].Delay = delayImage;
     imgobj.Dispose();
}

int loopMovie = 10; // Loop Gif
NewFileGif.NumberOfAnimationCycles = loopMovie;

NewFileGif.Save(this.ListContens[0].PathMovieOutput);
NewFileGif.Dispose();
Best regards, Alexander

dovanmy211
Posts: 5
Joined: Mon Mar 11, 2013 5:51 am

Re: Issue set delay Frame in Convert to .gif

Post by dovanmy211 » Tue Mar 12, 2013 5:54 am

Thanks you ^^.
Best regards

dovanmy211
Posts: 5
Joined: Mon Mar 11, 2013 5:51 am

Re: Issue set delay Frame in Convert to .gif

Post by dovanmy211 » Wed Mar 20, 2013 4:14 pm

Hi Alex.
I'm having issue set page delay in converting to gif.I play 45 Image in 10s. IMG 01 -> 15 play ins 1s. IMG 16->45 Play in 1s and loop count = 10. I can set loop count = 10 in about IMG 16->45 ? or how to other resolve
I'm using version 6.1 from your application.

Thanks in advance!
Best regards,

dovanmy211
Posts: 5
Joined: Mon Mar 11, 2013 5:51 am

Re: Issue set delay Frame in Convert to .gif

Post by dovanmy211 » Thu Mar 21, 2013 11:33 am

Hi Alex,

I want convert as follows:
Convert GIF File total 60 IMAGE
[00001~00015] play [0.5s] and loop count = 1+[00016~00045] play [1s] and loop count = 9 +[00046~000060] play [0.5s] and loop count = 1

My current code :
[00001~00015] : Add 10 Image to GIF File
[00016~00045] : Add 9 time Image [00016~00045] to repeat 9 time. 30img x 9 = 270 => Add 270 Img. Size output too large
[00046~000060] : Add 15 Image [00046~000060].

I can set loop count about [00001~00015] = 1. [00016~00045] = 9, [00046~000060] = 1 ? or how to other resolve

Thanks!
Best regards,

Alex
Site Admin
Posts: 1524
Joined: Thu Jul 10, 2008 2:21 pm

Re: Issue set delay Frame in Convert to .gif

Post by Alex » Thu Mar 21, 2013 2:53 pm

GIF file has only 1 parameter:
  • Loop count for ALL pages of file
GIF page also has only 1 parameter:
  • Delay for page
You should use the loop count if you can apply it for all pages of GIF file.

Best regards, Alexander

Post Reply