"The thing is I do not know how to select an object to use ObjCopyToClipboard".
To select an object with the mouse:
procedure TForm1.SelectObject1Click(Sender: TObject);
begin
ImageEnVect1.DeSelect;
ImageEnVect1.MouseInteractVt := [miObjectSelect];
end;
Then select an object with the mouse and then call Button1Click:
procedure TForm1.Button1Click(Sender: TObject);
var
i: integer;
hobj: integer;
iObjectSelected: boolean;
iSelection: boolean;
begin
iObjectSelected := False;
iSelection := ImageEnVect1.Selected;
for i := ImageEnVect1.ObjectsCount - 1 downto 0 do
begin
hObj := ImageEnVect1.GetObjFromIndex(i);
iObjectSelected := ImageEnVect1.IsSelObject(hObj);
{ Note: objects and a selection may exist at the same time }
if iObjectSelected then
begin
ImageEnVect1.ObjCopyToClipboard;
ShowMessage('An object is selected.')
end;
end;
if (iSelection) and (iObjectSelected) then
ShowMessage('An object is selected and there is a selection.')
else if (iSelection) and (not iObjectSelected) then
begin
ImageEnVect1.Proc.SelCopyToClip;
ShowMessage('Image has selection.');
end
else if (not iSelection) and (not iObjectSelected) then
begin
ImageEnVect1.Proc.SelCopyToClip;
ShowMessage('Nothing is selected.');
end;
end;
William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html