TImageEnVect.AlignObjects
Declaration
procedure AlignObjects(Alignment: TIEAlignLayers; bSelectedOnly: Boolean = true);
Description
Aligns objects relative to the image or other objects. If bSelectedOnly is false, then all objects are aligned.
Example
// Move all objects to the center of the image
ImageEnView1.AlignObjects(ilaAlignToVerticalCenter);
See the help file...
I am not aware of any procedures to arrange objects with equal spacing, but this may work:
procedure TForm1.AdjustObjectSpacing(APercent: Double);
// Adjust selected object spacing (left and top) by APercent
// APercent values can be negative and positive values (0.10, 0.25, -0.10, -0.25)
// Negative APercent values reduce spacing
// Positive APercent values increase spacing
var
i: Integer;
iHObj: Integer;
begin
// find all objects and adjust spacing by APercent
for i := 0 to ImageEnVect1.SelObjectsCount - 1 do
if i >= 0 then
begin
iHObj := ImageEnVect1.SelObjects[i];
ImageEnVect1.ObjLeft[iHObj] := ImageEnVect1.ObjLeft[iHObj] + Round(ImageEnVect1.ObjLeft[iHObj] * APercent);
ImageEnVect1.ObjTop[iHObj] := ImageEnVect1.ObjTop[iHObj] + Round(ImageEnVect1.ObjTop[iHObj] * APercent);
end;
ImageEnVect1.Update;
end;
AdjustObjectSpacing(StrToFloat(Spacing1.Text));
AdjustObjectSpacing(0.10);
Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development