ImageEn, unit ievect

TImageEnVect.RemoveObject

TImageEnVect.RemoveObject


Declaration


procedure RemoveObject(hobj: integer);


Description


RemoveObject removes the hobj object.

IEV_PREVIOUS_INSERTED_OBJECT can be specified for hobj to refer to the object that last inserted.
IEV_ALL_SELECTED_OBJECTS can be specified for hobj to refer to all objects that are currently selected.



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;