Wednesday, 15 January 2014

Array of TImage (Delphi Android) -



Array of TImage (Delphi Android) -

procedure tform1.controlclick(sender: tobject); var i: integer; begin := 2 dest.count-1 begin img[i-2].create(form1); img[i-2] begin parent:= panel1; width:= 100; height:= 150; top:= 10; left:= (i-2)*100; end; end; end;

img type array of timage, command tab. want timages show android gallery. gives me error access violation.

this looks classic error in creating object. instead of

obj.create;

you must write:

obj := tsomeclass.create;

in case need first of allocate array:

setlength(img, dest.count-2);

and in loop write:

img[i-2] := timage.create(form1);

to instantiate images.

delphi

No comments:

Post a Comment