Autor Beitrag
Crazy K
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 16



BeitragVerfasst: Di 25.03.03 19:11 
Hi, ich würde mich freuen, wenn ihr mir bei folgendem Problem helfen könntet!

Ich will, dass der User, wenn auf auf einen Button drückt, sich ein Bild auf einem TImage anzeigen kann also habe ich folgendes für das Ereignis onClick hinter den Button programmiert:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
procedure TForm1.BitBtn2Click(Sender: TObject);

var
bitmap: TBitmap;
begin
bitmap.Create; // hier bricht der debugger mit einem Fehler ab!
if OpenDialog1.Execute then
    begin
    bitmap.LoadFromFile(opendialog1.FileName);
    Image1.Canvas.Draw(0,0,bitmap);
    bitmap.Free;
    end;


end;


bei bitmap.create bricht der debugger ab..mit der Fehlermeldung:


Projekt Projekt1.exe raised exception class EAccessViolation with message 'Assessviolation at adress...

Kann mir jemand sagen woran das liegt???
Aya
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Di 25.03.03 19:13 
Hi,

schreib mal dashier:

ausblenden Quelltext
1:
Bitmap:=TBitmap.Create;					


Au'revoir,
Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!
Crazy K Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 16



BeitragVerfasst: Di 25.03.03 19:19 
OK vielen Dank für die schnelle Antwort. Jetzt habe ich versucht ein Bitmap zu laden..und er brach dann mit der Meldung, es sei kein korektes Image wieder ab. Wie kann ich aber feststellen, ob ein richtiges Image geladen wurde???
Aya
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Di 25.03.03 19:35 
was für ein Bild versuchst du denn zu laden???

mit einem Bitmap.LoadFromFile kann man nur BMP Dateien öffnen :)

Au'revoir,
Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!