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 a selection to a layer
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

AndyColmes

USA
351 Posts

Posted - May 20 2015 :  10:42:57  Show Profile  Reply
I would like to make a selection like a polygon or rectangle, copy it to the clipboard and pasting it in a new layer but in the same spot as the original selection. Much like in Photoshop, I would like to then be able to toggle the visibility of the background and the layer.

In the past, I tried this but the pasting of the selection to a new area does not always end up in the same spot and needs some moving of the layers to put it in the right spot.

How would I do this correctly?

Thanks in advance.

Andy

w2m

USA
1990 Posts

Posted - May 20 2015 :  11:38:27  Show Profile  Reply
Hi Andy,

You do not need to use the clipboard. All you have to do is use LayersCreateFromSelection;
procedure TForm1.CreateLayerFromSelection1Click(Sender: TObject);
begin
  if ImageEnView1.Selected then
  begin
    { Create a new layer from selection }
    ImageEnView1.LayersCreateFromSelection;
    ImageEnView1.DeSelect;
    ImageEnView1.Update;
    ImageEnView1.Bitmap.Modified := ImageEnView1.Proc.UndoCount > 0;
    { Turn on Layers selection }
    ImageEnView1.Gestures.Pan.Enabled := False;
    ImageEnView1.Gestures.Zoom.Enabled := False;
    SelectLayers1.Down := True;
    ImageEnView1.MouseInteract := [miMoveLayers, miResizeLayers];
  end;
end;

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

AndyColmes

USA
351 Posts

Posted - May 20 2015 :  13:48:02  Show Profile  Reply
Wow, Bill! That's amazing. Saves a lot of work with that.

Thanks a million as usual, Bill.

Andy
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: