ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Copy and paste objects
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

superdev

20 Posts

Posted - Aug 31 2019 :  20:51:36  Show Profile  Reply
You are using ImageEnvert.
When you select an object, you copy and paste it,
The selected object is not copied.
ImageEnvert's image is copied.
I want to copy and paste the selected object to the clipboard.
The sauce I used is as follows.

procedure TfrmMain.imgViewKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
  if ((ssCtrl in Shift) and (key=ord('C'))) then begin
    imgView.ObjCopyToClipboard;
  end else if ((ssCtrl in Shift) and (key=ord('V'))) then begin
    imgView.UnSelAllObjects;
    imgView.ObjPasteFromClipboard(MousePos.X,MousePos.Y);
    imgView.Update;
  end;
End;

xequte

38616 Posts

Posted - Sep 01 2019 :  19:36:33  Show Profile  Reply
Hi

Does it only happen with the Ctrl+C shortcut? E.g. works correctly if you put imgView.ObjCopyToClipboard; in a button click?

If so, try setting Key := 0; in your code above.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

superdev

20 Posts

Posted - Sep 01 2019 :  21:05:48  Show Profile  Reply
The code below will operate normally. There is a problem with the keyboard.


procedure TfrmMain.btnCopyClick(Sender: TObject);
begin
  imgView.ObjCopyToClipboard;
end;

procedure TfrmMain.btnPasteClick(Sender: TObject);
begin
  imgView.UnSelAllObjects;
  imgView.ObjPasteFromClipboard(MousePos.X,MousePos.Y);
  imgView.Update;
end;
Go to Top of Page

xequte

38616 Posts

Posted - Sep 02 2019 :  01:06:21  Show Profile  Reply
Hi

I think the Ctrl+C is being handled elsewhere by ImageEn.

Did this not work?

procedure TfrmMain.imgViewKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
  if ((ssCtrl in Shift) and (key=ord('C'))) then 
  begin
    imgView.ObjCopyToClipboard;
    Key := 0;
  end 
  else 
  if ((ssCtrl in Shift) and (key=ord('V'))) then 
  begin
    imgView.UnSelAllObjects;
    imgView.ObjPasteFromClipboard(MousePos.X,MousePos.Y);
    imgView.Update;
    Key := 0;
  end;
End;

How about removing loKeyboardShortcuts from ImageEnVect1.LayerOptions?

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

superdev

20 Posts

Posted - Sep 03 2019 :  01:36:45  Show Profile  Reply
Thank you for your prompt reply.
"Key=0" was used for normal operation.
However, due to the mouse position value of the lower mouse by mistake,
Bitmap location has been copied out.



procedure TfrmMain.imgViewKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
  if ((ssCtrl in Shift) and (key=ord('C'))) then 
  begin
    imgView.ObjCopyToClipboard;
    Key := 0;
  end 
  else 
  if ((ssCtrl in Shift) and (key=ord('V'))) then 
  begin
    imgView.UnSelAllObjects;
    imgView.ObjPasteFromClipboard(MousePos.X,MousePos.Y);
    imgView.Update;
    Key := 0;
  end;
End;
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: