Autor Beitrag
Dia
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 26



BeitragVerfasst: Di 13.11.07 17:43 
Hi,

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:
var
  Fcalender: TFcalender;
  today: word; {Datum des Türchens}
  year, month, day: word; {Datum Systemzeit}
  present: Tdatetime;
  valuable: boolean;
  Pict: TPicture;
  filename: string; {Picturefile}
implementation

{$R *.DFM}



procedure PPict(I1: TImage; Pict:TPicture; filename:string);
begin
Pict:=TPicture.Create;
Pict.LoadFromFile(filename);
I1.Picture:=Pict;   {I1 ist ein TImage}
end;


procedure TFcalender.L1Click(Sender: TObject);
begin
today:=strtoint(l1.caption);
Pdatum(present,year, today, day,month,Lcheat);
if valuable = true then
   begin
   filename:='silvia.jpg';
   PPict (I1, Pict, filename);
   end;

end;     {<- hier tritt die Exeption auf}



Am letzten end tritt die Exeption auf. Wenn ich bpms lade kommt der Fehler nicht.

JPEG ist in Uses eingefügt. Es wird auch ein bissel was geladen, aber halt nicht das ganze Bild.

Hat jemand eine Idee.

Danke
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Di 13.11.07 17:59 
user profile iconDia hat folgendes geschrieben:
Es wird auch ein bissel was geladen, aber halt nicht das ganze Bild.

Image kleiner als das zuladende Bild? -> Bild stauchen. ;)

Bei mir funktioniert es mit JPEGs übrigens einwandfrei, den Fehler kann ich imo nicht reproduzieren. Sorry. :P

grüße,
Marc
Dia Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 26



BeitragVerfasst: Di 13.11.07 19:29 
OK,

das muss natürlich bmp heißen. Egal.
Das es nicht alles läd mein ich anders:

Er läd den Hintergrund (weiße Fläche) des Bildes zum Teil, aber halt nicht das, was drauf ist. Sieh so ein bissel aus, als wenn ein Programm beim Laden einer Grafik abstürzt.
-> na ja, irgendwie tut es das ja auch.

Muss man beim speichern eines Jpegs irgendwas beachten. Das muss ja am Format liegen. Oder muss man noch was anderes machen außer JPEG in die Uses schreiben?
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Di 13.11.07 19:39 
Moin!

Warum machst du es nicht so: :gruebel:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TFcalender.L1Click(Sender: TObject);
begin
  today:=strtoint(l1.caption);
  Pdatum(present,year, today, day,month,Lcheat);
  if valuable then
    I1.Picture.LoadFromFile('silvia.jpg');
end;

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Dia Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 26



BeitragVerfasst: Di 13.11.07 19:52 
Also, ich hab's zum Laufen gebracht. Ich weiß zwar nicht warum, aber es lag an der Größe des Bildes.
Die Grafik war ursprünglich größer als mein Image (AutoSize = True). Jetzt hab ich die Grafik kleiner gemacht als das Image (Autosize diesmal false) und es hat funktioniert. Keine Ahnung warum aber es tut.