Hi
Do you still need that user data in the objects after the transfer?
If not, can you just iterate through the objects after the CopyAllObjectsTo:
Lyr.UserData := Obj^.UserData;
Lyr.UserDataLen := Obj^.UserDataLength;
Obj^.UserData := nil;
Obj^.UserDataLength := 0;
If you email me you can use the new "move" parameter, which transfers the object data then removes the object.
var
i, hobj: Integer;
begin
// Move the content of a TImageEnVect (with Objects) to a TImageEnView (as layers)
// Clear existing content
ImageEnView1.ClearAll();
// Copy background image
ImageEnView1.IEBitmap.Assign( ImageEnVect1.IEBitmap );
// Add objects as layers
for i := ImageEnVect1.ObjectsCount - 1 downto 0 do
begin
hobj := ImageEnVect1.GetObjFromIndex(i);
ImageEnVect1.CopyObjectTo( hobj, ImageEnView1, True ); // User data also transferred
end;
end;
Nigel
Xequte Software
www.imageen.com