![]() |
Bittmaps in Array of TBitmap schreiben
Hallöschen,
ich versuche ein paar Bitmaps verkleinert in ein Array of Bitmap zu schreiben.
Delphi-Quellcode:
Aber ich bekomme immer eine Invalid - Pointer Exception...
...
Type Athumps = Array of Tbitmap; var thumps : Athumps; ... procedure TForm5.makeminimap; VAR a,b,i,he,wi,x,y : INTEGER; Bild :TBitmap; jpeg: TJpegImage; begin he := 1000 DIV unit1.YLENTH; wi := 1000 DIV unit1.XLENTH; setlength(thumps,0); setlength(thumps,form1.ListBox2.Count); Bild := TBitmap.Create; jpeg := TJpegImage.Create; Bild.Width := wi; Bild.Height := he; for i := 1 TO form1.ListBox2.Count do BEGIN Jpeg.Assign(form2.getPicture(i)); Bild.Canvas.StretchDraw(Rect(0, 0, wi, he),Jpeg); thumps[i] := Tbitmap.Create; thumps[i].Assign(Bild); END; END; Was mache ich Falsch?! gruß Evian |
Re: Bittmaps in Array of TBitmap schreiben
Delphi-Quellcode:
Muss heißen:
for i := 1 TO form1.ListBox2.Count do
Delphi-Quellcode:
for i := 0 TO form1.ListBox2.Count-1 do
|
Re: Bittmaps in Array of TBitmap schreiben
Wo gibst du "JPeg" eigentlich wieder frei?
N Kleiner Tipp noch(Nicht böse nehmen :thumb: ): ![]() |
Re: Bittmaps in Array of TBitmap schreiben
mh.. :roll: diese doofen Felder, warum müssen die auch immer bei 0 anfangen ?!
ohh Gott, wenn das mein Alter Informatik Lehrer sehen würde... Zitat:
|
Re: Bittmaps in Array of TBitmap schreiben
Ich sehe 2 begins und 2 ends ;) demnach sollte das Jpeg schon dort freigegeben(Try/Finally) sein.
Aber ich kann mich natürlich auch irren ;) MfG |
Re: Bittmaps in Array of TBitmap schreiben
ja hatte den Code rauscopiert und dann einfach nen End hinten rangeschrieben ... damitt keiner sagt .. "ey da fehlt ja ein End" .. :D
|
Re: Bittmaps in Array of TBitmap schreiben
Jetzt hattest du jemand der Dir sagt das ein Objekt nicht freigegen wird. - Viel schlimmer. Ich hoffe du hast daraus gelernt! :warn: :mrgreen: :mrgreen: :mrgreen:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:06 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz