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
 Interactive Zooming With Layers
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Elemental

USA
56 Posts

Posted - Nov 25 2020 :  21:27:46  Show Profile  Reply
Please see attached Delphi XE7 project written with ImageEn 9.2.6. The form has a TImageEnView and four buttons which 1) load an image, 2) enable layer drawing, 3) enable interactive zooming, and 4) zoom to the whole image. Compile and run the program.

When the zoom tool is active, you can draw a rectangle and zoom in to any part of an image. But once you draw one or more layers, the zoom tool exhibits odd behavior. If you draw a zoom rectangle that does NOT overlap a layer, nothing happens; you get no closer to the image. If you draw a zoom rectangle that DOES overlap a layer, the view will zoom to that layer only.

On a related note, you can see the dotted zoom rectangle when there are no layers on the map, as you draw the zoom area. But if there are one or more layers on the image and the zoom tool does not cross one, you can't see this dotted line rectangle. But if you cross a layer, you can only see the dotted line within the layer.

To me, this is unexpected behavior. The miSelectZoom should allow the user to draw a rectangle anywhere they want and the image should zoom to that area.

Is there a property I'm not setting or am supposed to set? I've tried several combinations of LayerOptions, SelectionOptions, MouseInteractGeneral, and MouseInteractLayers values.

"Roj"

attach/Elemental/20201125212546_ZoomingWithLayers.zip
6.7 KB

xequte

38182 Posts

Posted - Nov 27 2020 :  13:41:05  Show Profile  Reply
Hi Roj

Selections are limited to the active layer, so if you are using miSelectZoom then you can only select a zoom within that layer.

If you want to be able to select a zoom over the whole image, ensure the background layer is active:

procedure TForm1.btnZoomClick(Sender: TObject);
begin
  ImageEnView1.LayersCurrent := 0;
  ImageEnView1.MouseInteractGeneral := [ miSelectZoom ];
end;


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

Elemental

USA
56 Posts

Posted - Nov 30 2020 :  13:24:35  Show Profile  Reply
That solved it. I apologize for not noticing that. I really did do a lot of research to try and figure this out on my own. I opened the Magnify, SoftPan, PanZoom, and Layers demos for examples, searched the help documents, but had not seen or noticed that critical line of code. Thank you.
Go to Top of Page

xequte

38182 Posts

Posted - Dec 01 2020 :  04:34:53  Show Profile  Reply
No worries, that's what we're here for.



Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: