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

giancarlo

Italy
65 Posts

Posted - Apr 06 2013 :  14:58:08  Show Profile  Reply
Hello,
i have to save/export a multi selection on a scanned image.
ImageEn 4 do support multi selections of rectangle areas?
If not, is possibile to save on file the clipboard content?
Some suggestion?

Thank you
Giancarlo

giancarlo

Italy
65 Posts

Posted - Apr 07 2013 :  06:13:53  Show Profile  Reply
i've discovered that imageenview do support multi selection, but i cannot find the way to get all the coordinates to copy each selection.
see the attach.
i need something like: ImageEnView1.Selections[i] :)

thank you

Go to Top of Page

w2m

USA
1990 Posts

Posted - Apr 07 2013 :  06:46:57  Show Profile  Reply
No you are incorrect. It may appear to be a multi-selection, but it is all the same selection. If you move the "selections" with the mouse all the selections move... You can not select one area, then select another area and independently move the selections. Presently there is no way to handle each selected area as an independent selection.

If you copy the "selections" to the clipboard you will see all of the selections with whitespace between the selected areas. You can not specify which rectangle to copy.

William Miller
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Go to Top of Page

giancarlo

Italy
65 Posts

Posted - Apr 07 2013 :  06:56:08  Show Profile  Reply
Ok, now i understand.
Best solution is allow user make the (single) selection, then save on file and deselect.
Is possibile lock only one selection area?
Thank you.
Go to Top of Page

w2m

USA
1990 Posts

Posted - Apr 07 2013 :  07:59:19  Show Profile  Reply
No, because there is still only 1 selection.

You could try creating a layer from a selection, so then you could make a selection, create a layer from the selection, copy it to the clipboard, then make another selection, create a layer from the selection, then copy it to the clipboard.

The currently selected layer is the layer that will be copied to the clipboard.

This is possible because you can have many layers and each layer is selectable.

For example using the layers demo from the samples folder you could add a check box to toggle selections or select layer, and a button to create the layer from the selection then add:

procedure Tfmain.Select1Click(Sender: TObject);
begin
  if Select1.Checked then
    ImageEnView1.MouseInteract := [miSelect]
  else
    ImageEnView1.MouseInteract := [miMoveLayers, miResizeLayers];
end;

procedure Tfmain.CreateLayerFromSelection1Click(Sender: TObject);
var
  ilayer: integer;
begin
  // copy selected area and create a new layer
  ilayer := ImageEnView1.LayersCreateFromSelection;
  ImageEnView1.LayersCurrent := ilayer;
  ImageEnView1.CurrentLayer.name := AnsiString('Layer ' + IntToStr(ilayer));
  ImageEnView1.CurrentLayer.VisibleBox := True;
  ImageEnView1.CurrentLayer.Selectable := True;
  ImageEnView1.LayersDrawBox := True;
  // move the new layer to top left
  ImageEnView1.CurrentLayer.PosX := 0;
  ImageEnView1.CurrentLayer.PosY := 0;
  // remove the selection
  ImageEnView1.DeSelect;
  ImageEnView1.LayersCurrent := 0;
  RefreshControls;
  RefreshLayerViewer;
end;

procedure Tfmain.CopyToClipboard1Click(Sender: TObject);
begin
  ImageEnView1.Proc.CopyToClipboard()
end;

William Miller
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: