With this code, all is working.
Thanks for your help.
procedure SelObjsInRect(im:TImageEnVect;aobj: integer; xx1, yy1, xx2, yy2: integer);
var
o: integer;
ax1, ay1, ax2, ay2: integer;
rc:TRect;
Kind:TIEVObjectKind;
begin
if aobj = -3 then
begin
for o := 0 to im.ObjectsCount - 1 do
SelObjsInRect(im, im.GetObjFromIndex(o) , xx1, yy1, xx2, yy2)
end
else
begin
im.GetObjRect(aobj,rc);
ax1 := rc.left;
ay1 := rc.top;
ax2 := rc.Right;
ay2 := rc.Bottom;
Kind:=im.ObjKind[aobj];
if (Kind = iekLINE) or (Kind = iekRULER) or (Kind = iekPOLYLINE) or (Kind = iekANGLE) or (Kind = iekLINELABEL) then
OrdCor(ax1, ay1, ax2, ay2);
if (ax1 >= xx1) and (ax2 <= xx2) and (ay1 >= yy1) and (ay2 <= yy2) and (not im.IsSelObject(aobj)) then
im.AddSelObject(aobj);
end;
end;
prcodeure copy_objects_and_image_from_rect;
begin
Item:= TImageEnVect.create(self);
........
if ( ImageEnVect1.Selected )then begin
ImageEnVect1.CopySelectionToIEBitmap(Item.IEBitmap);
SelObjsInRect(ImageEnVect1,-3,
ImageEnVect1.SelX1, ImageEnVect1.SelY1,
ImageEnVect1.SelX2, ImageEnVect1.SelY2);
for i:=0 to ImageEnVect1.SelObjectsCount - 1 do begin
hobj:=ImageEnVect1.SelObjects[i];
ImageEnVect1.GetObjRect(hobj,rc);
kk:=ImageEnVect1.ObjLeft[hobj];
ImageEnVect1.CopyObjectTo(hobj ,Item);
jj:=ImageEnVect1.SelX1;
Item.ObjLeft[-2]:=kk-jj;
kk:=ImageEnVect1.ObjTop[hobj];
jj:=ImageEnVect1.SelY1;
Item.ObjTop[-2]:=kk-jj;
end;
Item.Update;
ImageEnVect1.UnSelAllObjects;
end