ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Animated GIF in ImageEnView

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
bmesser Posted - Mar 28 2014 : 12:48:57
Hi

Thanks to Nigel's wonderful demo I can now produce animated GIF's to my hearts content.

Today I thought I would use a TImageEnView component to display and animate the same GIF's that I create.

I load the GIF after setting the playloop to continuous. I check out how many frames I have and that reports back correctly. I set playing to true but I don't get any animation.

Image.PlayLoop:=True;
Image.IO.LoadFromFileGIF('Test.GIF');
Debug(Format('Images = %d',[Image.IO.Params.ImageCount]));
Image.Playing:=True;

Am I missing a step here?

If I load the same GIF in IrfanView it works correctly and continuously.

I download an animated GIF of the net and it's just the same although it does seem to loop once.

Bruce.
9   L A T E S T    R E P L I E S    (Newest First)
bmesser Posted - Apr 06 2014 : 01:11:59
Bill

I dropped the optimisation process which speeded up the whole creation process and the hourglass cursor seems to work through the whole process now!

Bruce.
w2m Posted - Apr 04 2014 : 10:58:28
You could try creating the GIF in a thread.

With respect to the 'bad' GIF file to fix it all you have to do is set the delay time and save the gif. Once you save it and reload it The gif will play correctly:
procedure TForm1.DelayTime1Change(Sender: TObject);
{ Set the delay time. }
var
  i: Integer;
begin
  { GIF_DelayTime is not used until the file is saved. }
  for i := 0 to ImageEnMView1.ImageCount - 1 do
    ImageEnMView1.MIO.Params[i].GIF_DelayTime := StrToInt(DelayTime1.Text);
end;

You can also fix the gif file by obtaining my gif maker app with source
http://www.imageen.com/ieforum/topic.asp?TOPIC_ID=1446
I will also try to help you with any specific problems with the gif maker should they occur. Creating a threaded gif maker would take some significant time to create the thread and for testing it, but that will not be free.

I will look at your the code that is time consuming if you post it or send it to me and will offer some comments or suggestions for free.

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Custom ImageEn Development
bmesser Posted - Apr 04 2014 : 10:42:51
Hi Nigel

Thanks for that!

There's just one comment I have when creating a large animated GIF is that it takes time! I do realise that there is a lot of processing going on, so I wrap my code in "screen.cursor:=crHourGlass" to indicate the application is processing the image, but the cursor fails to appear and it looks like the app has stalled.

I just wonder if there is anyway round that?

Bruce.
xequte Posted - Apr 04 2014 : 02:49:39
Hi Bruce

This fix will appear in v5.1.0, which should be ready very shortly.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
bmesser Posted - Apr 04 2014 : 02:47:17
Hi

Sorry for the delay in replying. I've put together the simplest two procedure demo and animated GIF's still fail to work in an ImageEnView component using the Fish example from Bill. I can see the frame count, but setting play to true produces nothing.

procedure TForm8.FormCreate(Sender: TObject);
begin
  ImageEnView1.IO.LoadFromFile(Format('%sfish.gif',[GetExePath]));
  ImageEnView1.PlayLoop:=True;

  Button1.Caption:=Format('%d images',[ImageEnView1.IO.Params.ImageCount]);
end;

procedure TForm8.Button1Click(Sender: TObject);
begin
  if ImageEnView1.Playing then
    ImageEnView1.Playing:=False
  else
    ImageEnView1.Playing:=True;
end;




I am using version 5.0.5, but I notice that we now have a version 5.0.6, and so hopefully that'll do the trick.

Bruce.
xequte Posted - Mar 30 2014 : 17:48:49
Hi

Animated GIF's, in general, should have a delay interval specified (i.e. not zero), as by the standard zero means to immediately show the next frame. However in practice, browsers assign a default interval to frames without one specified (or that are too fast).

For v5.1.0 we will make TImageEnView assign a default interval of 100ms if one is not specified.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
w2m Posted - Mar 29 2014 : 13:20:20
Nigel,

Here are two animated gif's that do not animate in TImageEnView. They do animate in TImageEnMView as well as in IFranView.




William Miller
xequte Posted - Mar 29 2014 : 02:05:34
Hi

You might want to try Bill's GIF creation demo too:

http://www.imageen.com/ieforum/topic.asp?TOPIC_ID=1446

It offers more functionality than mine.


Can you post or forward some GIF's that do not animate? I cannot see any reason why your code should be failing.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
w2m Posted - Mar 28 2014 : 13:45:49
Hi Bruce:

This works nicely here:
procedure TForm1.Play2Click(Sender: TObject);
{ Animinate the GIF in TImageEnView. }
begin
  ImageEnView1.IO.LoadFromFile(AFileName);
  if Play2.Down then
  begin
    ImageEnView1.Playing := True;
    ImageEnView1.PlayLoop := True;
  end
  else
  begin
    ImageEnView1.Playing := False;
    ImageEnView1.PlayLoop := False;
  end;
end;

I think the sequence of your calls may be incorrect. First load the file then set Playing and PlayLoop,

I found that some gif files did not animate when played in TimageEnView, but the same file animated correctly in TImageEnMView in the same application. I have no idea why.

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Custom ImageEn Development