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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Copy a selection to a layer

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
AndyColmes Posted - May 20 2015 : 10:42:57
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
2   L A T E S T    R E P L I E S    (Newest First)
AndyColmes Posted - May 20 2015 : 13:48:02
Wow, Bill! That's amazing. Saves a lot of work with that.

Thanks a million as usual, Bill.

Andy
w2m Posted - May 20 2015 : 11:38:27
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