Use the ImageEnVect1NewObject event:
procedure TForm1.ImageEnVect1NewObject(Sender: TObject; hobj: Integer);
{ Center any new object in the center of TImageEnVect. If more than one object
is added and the first object is not moved, the second object will be placed over
the first object }
begin
ImageEnVect1.ObjLeft[hobj] := ImageEnVect1.ClientWidth div 2;
ImageEnVect1.ObjTop[hobj] := ImageEnVect1.ClientHeight div 2;
end;
procedure TForm1.ImageEnVect1NewObject(Sender: TObject; hobj: Integer);
{ Center any new object near the center of TImageEnVect. If more than one object
is added, subsequent objects will be offset for the previous so that all objects
are near the center but are slightly offset }
var
iObjectCount: Integer;
begin
iObjectCount := ImageEnVect1.ObjectsCount;
ImageEnVect1.ObjLeft[hobj] := (ImageEnVect1.ClientWidth div 2) + (iObjectCount * 5);
ImageEnVect1.ObjTop[hobj] := ImageEnVect1.ClientHeight div 2 + (iObjectCount * 5);
end;
Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development