Autor Beitrag
rubooo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 52

WIN XP
Delphi 2005 Prof
BeitragVerfasst: Mi 01.10.08 07:43 
Hallo ich will ein gif in meine Form1 einfügen mit Hilfe einer TImage Komponente und TGIFImage.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure TForm1.FormCreate(Sender: TObject);
var  Gif : TGIFImage;
begin
  Gif := TGifImage.Create;
  gif.LoadFromFile('load.gif');
  Image1.Picture.Assign( gif );
  gif.Free;
end;


Allerdings hängt das Programm sich dann vollkommen auf..


Zuletzt bearbeitet von rubooo am Mi 01.10.08 08:14, insgesamt 1-mal bearbeitet
DeddyH
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mi 01.10.08 08:11 
TImage1? Du meinst sicher Image1, oder?
rubooo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 52

WIN XP
Delphi 2005 Prof
BeitragVerfasst: Mi 01.10.08 08:13 
ja natuerlich tippfehler
DeddyH
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mi 01.10.08 08:19 
Müsste das nicht auch einfach so funktionieren?
ausblenden Delphi-Quelltext
1:
Image1.Picture.LoadFromFile(ExtractFilePath(ParamStr(0)) + 'load.gif');					
rubooo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 52

WIN XP
Delphi 2005 Prof
BeitragVerfasst: Mi 01.10.08 08:51 
Was sollte das bringen .. ist doch ein relativer Pfad...
Ich frag mich ja nur warum es sich aufhängt. Finden tut er das Bild defenitiv!
DeddyH
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mi 01.10.08 09:04 
An welcher Stelle hängt er sich denn auf?
rubooo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 52

WIN XP
Delphi 2005 Prof
BeitragVerfasst: Mi 01.10.08 09:09 
na wenn er das bild ladet .....
Matthias-K
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 271

Win95, Win98, Win2000, WinXP, Linux
D2, D4 Client/Server, D5 Enterprise, D6 Enterprise, D7 Enterprise, Delphi2005, C/C++ 3.0, C/C ++ 5.0, C/C++ 6.0
BeitragVerfasst: Mi 01.10.08 09:18 
im formcreate macht man sowas gar nicht....

_________________
Ein Spezialist ist ein Mensch, der immer mehr von immer weniger weis, bis er alles von nichts weis!
rubooo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 52

WIN XP
Delphi 2005 Prof
BeitragVerfasst: Mi 01.10.08 09:37 
das stimmt aber auch wenn ich es in einem anderen Event mache funktioniert es nicht.
DeddyH
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mi 01.10.08 09:38 
Hast Du es mal mit einer anderen Grafik versucht?
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mi 01.10.08 09:42 
Kommt Timage.Picture überhaupt mit Gif-Dateien klar? Soweit ich weiß nämlich nicht. Oder lädt TGifImage das intern in ein Bitmap? Geht das dann in etwa so?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
  Gif := TGifImage.Create;
  gif.LoadFromFile('load.gif');
  Image1.Picture.Bitmap.Assign( gif.Picture.Bitmap );
  gif.Free;

_________________
We are, we were and will not be.
rubooo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 52

WIN XP
Delphi 2005 Prof
BeitragVerfasst: Mi 01.10.08 09:51 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
Gif := TGifImage.Create;
Gif.LoadFromFile('load.gif');
Image1.Picture.Bitmap.Assign(gif.Bitmap);
Gif.Free;


so gehts aber das Bild bewegt sich null -.-
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mi 01.10.08 09:56 
Ja, weil ein TImage ein Bild anzeigt, und nicht auf animierte Gifs vorbereitet ist. In dem Fall solltest du mal nach visuellen Gif-Komponenten suchen, die auch mit animierten Gifs klarkommen. Bei torry sollte man was dazu finden.

_________________
We are, we were and will not be.
rubooo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 52

WIN XP
Delphi 2005 Prof
BeitragVerfasst: Mi 01.10.08 10:01 
ja hab ich schon geguckt . Hab ja auch die TGIFImage wie du sehen kannst.
Hab auch da geguckt und gegoogelt .. finde aber keine Lösung.
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mi 01.10.08 10:02 
Ich bin davon ausgegangen, dass TGifImage keine visuelle Komponente ist, also nur zum Laden der Daten gedacht ist, nicht zum Anzeigen - falls doch: Warum nimmst du dann überhaupt noch ein TImage?

_________________
We are, we were and will not be.
Matthias-K
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 271

Win95, Win98, Win2000, WinXP, Linux
D2, D4 Client/Server, D5 Enterprise, D6 Enterprise, D7 Enterprise, Delphi2005, C/C++ 3.0, C/C ++ 5.0, C/C++ 6.0
BeitragVerfasst: Mi 01.10.08 10:04 
die indy kompos liefern soas mit, wenn ich des richtig gelesen hab!

_________________
Ein Spezialist ist ein Mensch, der immer mehr von immer weniger weis, bis er alles von nichts weis!
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: Mi 01.10.08 10:05 
user profile iconGausi hat folgendes geschrieben Zum zitierten Posting springen:
Ich bin davon ausgegangen, dass TGifImage keine visuelle Komponente ist, also nur zum Laden der Daten gedacht ist, nicht zum Anzeigen - falls doch: Warum nimmst du dann überhaupt noch ein TImage?


Doch, TGifImage ist die visuelle Komponente ;)
Warum er das noch in ein normales TImage umkopiert, ist mir auch ein Rätsel.

_________________
PROGRAMMER: A device for converting coffee into software.
DeddyH
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mi 01.10.08 10:06 
user profile iconMatthias-K hat folgendes geschrieben Zum zitierten Posting springen:
die indy kompos liefern soas mit, wenn ich des richtig gelesen hab!

Indy? Oder meinst Du JEDI?
rubooo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 52

WIN XP
Delphi 2005 Prof
BeitragVerfasst: Mi 01.10.08 10:08 
Neee ich will ja GifImage benutzen...
Ich glaub auch nicht dass die sowas mitliefern
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: Mi 01.10.08 10:10 
user profile iconrubooo hat folgendes geschrieben Zum zitierten Posting springen:
Neee ich will ja GifImage benutzen...
Ich glaub auch nicht dass die sowas mitliefern

Dann tu das doch, und kopier das nicht in ein TImage um?!

Setz das entweder zur Designtime aufs Formular, und lad zur Laufzeit nur noch das Bild,
oder schau dir nochmal an, wie man Komponenten zur Laufzeit erzeugt. Parent und Position setzen, und du darfst das Bild natürlich nicht sofort wieder freigeben.

_________________
PROGRAMMER: A device for converting coffee into software.