Autor Beitrag
LastRide
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47



BeitragVerfasst: Di 24.06.08 14:25 
Hey,

Ich würde gerne TGA-Grafiken über opendialog in ein Timage laden weis jemand wie ich das anstellen kann ??

MfG LastRide
nagel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 708

Win7, Ubuntu 10.10

BeitragVerfasst: Di 24.06.08 15:06 
LastRide Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47



BeitragVerfasst: Mi 25.06.08 07:24 
Hey Super ;). Kannst du mir vllt. auch kurz sagen wie ich die Komponente installiere da es nirgends dabei steht ;).

MfG LastRide
nagel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 708

Win7, Ubuntu 10.10

BeitragVerfasst: Mi 25.06.08 08:42 
Da ist doch 'ne chm-Hilfedatei drin. Aber eigentlich brauchst du garnichts installieren, sondern einfach in uses eintragen.
LastRide Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47



BeitragVerfasst: Mi 25.06.08 09:31 
Ja das habe ich mir auch durchgelesen ;). nur war die Frage eher wie man es bei Uses einbinden muss ;).

MfG LastRide
LastRide Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47



BeitragVerfasst: Do 26.06.08 13:46 
Hmm,

Irgendwie komme ich nicht weiter ich habe jetzt den Bibliothekspfad auf den Ordner gesetzt und dann in meinen Uses auch GraphicEx eingetragen nur wenn ich jetzt das bild einbinden bzw. Öffnen will bekomme ich direkt eine Fehler Meldung von wegen unbekannte Dateierweiterung weiß vllt. jmand was zu tuen ist ;)??.

MfG LastRide
LastRide Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47



BeitragVerfasst: Sa 28.06.08 11:18 
Hmm hier kommt nicht viel drum gebe ich euch mal meinen Code dazu ;).

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, XPMan, ExtDlgs, ExtCtrls, GraphicEx;

type
  TForm1 = class(TForm)
    Image1: TImage;
    XPManifest1: TXPManifest;
    Button1: TButton;
    OpenDialog1: TOpenDialog;
    Memo1: TMemo;
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;


var
  Form1: TForm1;

{$define TargaGraphic}
implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
x:string;
i:integer;
begin
OpenDialog1.Execute;
Memo1.Lines.Add(OpenDialog1.Files[i]);
x:= Memo1.Text;
Image1.Picture.LoadFromFile(x);
end;
end.


gibt mir aber aller hand fehler aus momentan hoffe auf eure hilfe .

MfG LastRide
Shorty
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 107

Win XP, Ubuntu 8.04
Delphi 7 Prof., Delphi 2005 Pers.
BeitragVerfasst: Sa 28.06.08 12:03 
Kann dir leider nicht direkt zu deinem Problem helfen, aber deine OnClick-Prozedur hat noch ein paar allgemeine Fehler, vielleicht lösen die schon das Problem:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
procedure TForm1.Button1Click(Sender: TObject);
var x:string;
    i:integer;
begin
  if OpenDialog1.Execute then // überprüfen, ob der Benutzer auf Auswählen geklickt hat 
    begin                     // und der Dialog nicht abgebrochen   wurden
      // Memo1.Lines.Add(OpenDialog1.Files[i]): i ist eine lokale Variable und hat einen zufälligen Wert,
      // lieber OpenDialog1.Files[0] oder am besten Opendialog1.Filename benutzen
      Memo1.Lines.Add(OpenDialog1.Filename);
      x:= Memo1.Text;
      Image1.Picture.LoadFromFile(x);
    end;
end;


Mfg Shorty
LastRide Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47



BeitragVerfasst: Sa 28.06.08 18:16 
Hey,

danke dir schonmal dafür jedoch behebt das mein Problem immer noch nicht nur der Button Klick funktioniert perfekt danke.

MfG

LastRide
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Sa 28.06.08 18:57 
Du solltest lieber beschreiben was nicht funktioniert mit Fehlermeldung etc. sonst wirst du wohl auf deinem Problem sitzen bleiben.
Wenn du mehrere Dateien ins Memo laden möchtest gehöhrt dort eine for schleife rein aber das solltest du hier im Forum finden.

_________________
Blackheart666
Der Irrsinn ist bei Einzelnen etwas Seltenes, - aber bei Gruppen, Parteien, Völkern, Zeiten die Regel. (Friedrich Nietzsche)
LastRide Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47



BeitragVerfasst: Sa 28.06.08 20:24 
nein Darum geht es nicht ;). also wie folgt wenn ich versuche ein .tga Bild einzuladen kommt folgender fehler.

user defined image

Und das trotz einbindung der GraphicEx-Komponente ich hoffe jetzt ist das Problem Klarer ;).

MfG

LastRide
LastRide Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47



BeitragVerfasst: Mo 30.06.08 11:06 
Hat keiner mehr eine Idee was zu machen ist?

Wäre für mein Projekt dann wohl oder übel das Ende.

Ich hoffe das sich noch jemand mit dem Problem auseinander Setzt.

MfG LastRide
nagel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 708

Win7, Ubuntu 10.10

BeitragVerfasst: Di 01.07.08 10:15 
So, hab's jetzt mal ausprobiert. Bei mir funktioniert's, also ich kann nicht nachvollziehen, warum da bei dir dieser Fehler kommt.
LastRide Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47



BeitragVerfasst: Di 01.07.08 20:43 
Dann sag mal bitte wie du es gemacht hast vllt. kriege ich es dann ja auch endlich hin ;).

MfG LastRide
Andreas L.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Di 01.07.08 20:53 
Da du die Komponente nicht installiert hast, sondern nur in Uses eingebunden, musst du manuell die Dateiendung registrieren. Sofern GraphicEx überhaupt mit TImage zusammen arbeitet. Falls nicht, gibts da sicherlich eine andere Komponente (vllt. TImageEx oder so). Kenne die Komponenten lieder nicht.

ausblenden Delphi-Quelltext
1:
TPicture.RegisterFileFormat					
nagel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 708

Win7, Ubuntu 10.10

BeitragVerfasst: Di 01.07.08 23:33 
user profile iconAndreas L. hat folgendes geschrieben:
Da du die Komponente nicht installiert hast, sondern nur in Uses eingebunden, musst du manuell die Dateiendung registrieren.

Keine Komponente, keine Installation. Und die Registrierung geht auch automatisch.



user profile iconLastRide hat folgendes geschrieben:
Dann sag mal bitte wie du es gemacht hast vllt. kriege ich es dann ja auch endlich hin ;).

Hab nicht viel gemacht: Image auf die Form, GraphicEx in Uses und im FormCreate ein .tga-File geladen.
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, GraphicEx, ExtCtrls;

type
  TForm1 = class(TForm)
    Image1: TImage;
    procedure FormCreate(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
Image1.Picture.LoadFromFile('pic.tga');
end;

end.


Deshalb sag ich ja, keine Ahnung wieso da bei dir 'ne Fehlermeldung kommt.
LastRide Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47



BeitragVerfasst: Mi 02.07.08 09:15 
Hey bei mir hat es auch geklappt.

Jetzt ist nur die Frage ob es auch möglich ist den Alphakanal mit zu interpretieren, weil alle meine Bilder mit Alphakanal nur auf Schwarzem Hintergrund angezeigt werden.

MfG

LastRide
LastRide Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47



BeitragVerfasst: Fr 04.07.08 17:49 
Kennt keiner eine Möglichkeit wie das Problem zulösen ist ?

MfG

LastRide