Autor Beitrag
Robii
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 236



BeitragVerfasst: Fr 12.03.10 18:22 
Guten Nachmittag,
Ich bin zwar mit Google oder mit der Suchmaschine fündig geworden, allerdings klappt keine der gefunden Lösungen. Ich möchte gerne das auf Buttonklick eine *.Gif gezeigt und 'abgespielt' wird.

Ich habe mir die TGIFImage heruntergeladen und als Package installiert. Mit folgendem Code habe ich es probiert:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
var
  tGif: TGifImage;
begin
tGif.Create;
try
  tGif.LoadFromFile('LadAn.Gif');
  Image1.Picture.Assign(tGif);
finally
  tGif.Free;
end;

Allerdings bekomme ich dann im Programm einen Zugriff's-Fehler.

Weiterhin habe ich versucht die *.Gif in eine *.Avi zu konvertieren und diese *.Avi dann in eine *.Res zu speichern.
Damit ich die *.Res dann mit TAnimate verwenden kann, allerdings hatt mir TAnimate dann immer den Fehler geliefert:
'Kann AVI nicht finden'

Ich hoffe ihr könnt mir nun helfen.

Lieben Gruß,
robii.

Moderiert von user profile iconNarses: Code- durch Delphi-Tags ersetzt
platzwart
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1054
Erhaltene Danke: 78

Win 7, Ubuntu 9.10
Delphi 2007 Pro, C++, Qt
BeitragVerfasst: Fr 12.03.10 18:24 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
var
  tGif: TGifImage;
begin
tGif:= TGifImage.Create;
try
  tGif.LoadFromFile('LadAn.Gif');
  Image1.Picture.Assign(tGif);
finally
  tGif.Free;
end;

_________________
Wissenschaft schafft Wissenschaft, denn Wissenschaft ist Wissenschaft, die mit Wissen und Schaffen Wissen schafft. (myself)
Robii Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 236



BeitragVerfasst: Fr 12.03.10 18:26 
Hey,

Danke erstmal für die schnelle Hilfe, allerdings wird mir die Animation jetzt einfach nur angezeigt, ohne das sie abgespielt wird. Wieso?

Lieben Gruß
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Fr 12.03.10 18:41 
Weil du die Animation einem (statischem) TImage zuweist?

_________________
PROGRAMMER: A device for converting coffee into software.
Robii Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 236



BeitragVerfasst: Fr 12.03.10 18:43 
Zitat:
Weil du die Animation einem (statischem) TImage zuweist?


Wie kann ich es denn sonst machen? Habt ihr vielleicht noch eine andere Idee um ein GIf anzeigen zu können?

Lieben Gruß.
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Fr 12.03.10 18:44 
TGifImage direkt als Komponente auf dem Formular platzieren.

_________________
PROGRAMMER: A device for converting coffee into software.
Robii Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 236



BeitragVerfasst: Fr 12.03.10 18:49 
E²: Hat sich geklärt.

Meine Lösung
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
uses
  GIFImg, ..


[..]

procedure TFORM1.XY(Sender: TObject);
var
  GIFimg: TGIFImage;
begin
GIFImageDefaultAnimate := True;
GIFimg:= TGIFImage.Create;
try
  GIFimg.LoadFromFile('*.gif');
  iLoad.Picture.Assign(GIFimg);
finally
  GIFimg.Free;
end;
end;


Man muss die Variable 'GIFImageDefaultAnimate' auf True setzen, diese regelt die globe Aktivierung von Animationen.
Quelle: melander.dk/delphi/gifimage/#faq_35

Moderiert von user profile iconNarses: Code- durch Delphi-Tags ersetzt


Zuletzt bearbeitet von Robii am Fr 12.03.10 21:31, insgesamt 2-mal bearbeitet
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Fr 12.03.10 21:29 
Hm.. bin mir grad nicht sicher, aber hat das GifImage nicht eine Eigenschaft Animated oder so, die man erst auf true setzen muss?

_________________
PROGRAMMER: A device for converting coffee into software.