ImageEn, unit ievect

TImageEnVect.ObjectsCount

TImageEnVect.ObjectsCount

Declaration

property ObjectsCount: Integer;

Description

Returns the number of objects in the TImageEnVect component. Use GetObjFromIndex to convert the index value to an Obj.

Read-only

Example

// Delete the objects of the specified layer
procedure DeleteObjectsOfLayer(iLayer: Integer);
var
  i: Integer;
  ihobj: Integer;
  iobjLayer: Integer;
begin
  for i := ImageEnVect1.ObjectsCount - 1 downto 0 do
  begin
    ihobj := ImageEnVect1.GetObjFromIndex(i);
    // if hobj is on current layer then delete the object
    iobjLayer := ImageEnVect1.ObjLayer[ihobj];
    if iobjLayer = iLayer then
      ImageEnVect1.RemoveObject(ihobj);
  end;
  ImageEnVect1.Update();
end;

Transition Information

If you are transitioning your code to TImageEnView Layers, instead of ObjectsCount, use: TImageEnView.LayersCount.
Note: LayersCount also includes the background layer. So it is always >= 1
n := ImageEnView1.LayersCount;

See Also

GetObjFromIndex