Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi Abstract Error (https://www.delphipraxis.net/15920-abstract-error.html)

hagi2 6. Feb 2004 13:40


Abstract Error
 
Hallo
Ich möchte ein Bild auf den Bildschirm zeichnen, und zwar ohne TImage zu benutzen. Also hab ichs mal so probiert:
Delphi-Quellcode:
var
  Form1: TForm1;
  hallo: TGraphic;
implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
hallo := TGraphic.Create;
hallo.LoadFromFile('xxx.bmp');
Form1.Canvas.Draw(200,200,hallo);
end;
Wird auch kompiliert, aber beim Drücken des Buttons kommt dann "Abstract Error"
Kenn mich da nicht so aus, was heißt das jetzt?

jbg 6. Feb 2004 13:57

Re: Abstract Error
 
TGraphic ist eine abstrakte Klasse. Du musst eine Klasse nehmen, die von TGraphic erbt, wie z.B. TBitmap.

hagi2 6. Feb 2004 19:16

Re: Abstract Error
 
Hat funktioniert. Danke!


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:23 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz