Forum: Object-Pascal / Delphi-Language
Delphi
by nEmai,
5. Apr 2008
@Muetze1
var
Bitmap: TBitmap;
begin
Bitmap:= TBitmap.Create;
Bitmap.FreeImage;
Bitmap.Free;
Bitmap.FreeInstance;
Forum: Object-Pascal / Delphi-Language
Delphi
by nEmai,
5. Apr 2008
So, nachdem ich mich durch die vielen Informationen durchgearbeitet hab..
@Muetze1:
FreeAndNil() kennt mein Delphi 2005 nicht.
@gmc616:
Eigentlich dachte ich schon, dass mir klar ist, was eine Instanz ist.
Dein Konstruktorvorschlag umgeht das Thema des Threads. oO
(Ich brauch die Variable in der Klasse.)
Forum: Object-Pascal / Delphi-Language
Delphi
by nEmai,
4. Apr 2008
Ok, das heißt, wenn ich es richtig versteh:
Image.Picture.Bitmap ist ein Pointer auf eine Bitmap, also eine Speicheradresse.
Dann müsste
var
ptrBitmap: ^TBitmap;
begin
ptrBitmap:= Image.Picture.Bitmap;
end;
Forum: Object-Pascal / Delphi-Language
Delphi
by nEmai,
4. Apr 2008
Nun ich wollte hier Zeiger einsetzen, weil ich mir die Bitmap an Image.Picture als Objekt TBitmap vorgestellt hab, mit dem ich arbeiten will.
Meine Logik sagt mir ich brauch nen Pointer darauf.
Aber ich hab es nun so gemacht und es geht. ^^
PBitmap: TBitmap;
..
PBitmap:= aImage.Picture.Bitmap;
Forum: Object-Pascal / Delphi-Language
Delphi
by nEmai,
4. Apr 2008
Und wenn ich es doch so machen wollte?
Ich will ja was bei lernen. Und dabei mein ich nicht unbedingt wie man es am besten macht. ^^
Forum: Object-Pascal / Delphi-Language
Delphi
by nEmai,
4. Apr 2008
Hiho,
Ich hab es (noch) nicht so mit Zeigern und daher keine Ahnung was Delphi nun wirklich von mir will.
TBarGraph = class
private
PBitmap: ^TBitmap;
FBars: Array of Integer;
procedure Bar(const aPosition, aValue: Integer);