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
 miSelectZoom problem
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

981 Posts

Posted - Aug 25 2017 :  12:36:49  Show Profile  Reply
The TIEMouseInteractItems documentation says:

"miSelectZoom: If the user selects an area, it will be automatically zoomed into (and become the new display view). Click and move the mouse to select the zoom rectangle"

So I use this button:

procedure TFormMain.btnImageSelectionZoomClick(Sender: TObject);
begin
  ImageEnView1.MouseInteract := [miSelectZoom];
end;


But when I click on it and then draw a selection with the mouse, nothing is zoomed!

PeterPanino

981 Posts

Posted - Aug 25 2017 :  12:56:17  Show Profile  Reply
Unfortunately, the documentation does not mention that [miSelectZoom] does not work if TImageEnView.AutoShrink = True!!

But I need AutoShrink to fit the whole image inside the Client area!

So how can I use [miSelectZoom] together with AutoShrink?
Go to Top of Page

w2m

USA
1990 Posts

Posted - Aug 25 2017 :  13:20:04  Show Profile  Reply
You can not use both at the same time because both affect zoom. You can fit the image when loading the image and then use SelectZoom after that. So when the image appears after loading it is set to the fit. When the zoom is changed with SelectZoom, and later want to refit the image just call Fit(True).

You can also add a Fit Speedbutton to toggle fitting and setting zoom level to 100%. This will produce the same effect as autoshrink and both can be used at the same time which will produce the same effect.
procedure TForm1.Fit1Click(Sender: TObject);
begin
  if Fit1.Down then
    ImageEnView1.Fit(True) // this is the same as AutoShrink
  else
    ImageEnView1.Zoom := 100;
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

PeterPanino

981 Posts

Posted - Aug 25 2017 :  16:53:50  Show Profile  Reply
Meanwhile I've found this other solution which works very well:

procedure TFormMain.btnImageEnViewClick(Sender: TObject);
begin
  ImageEnView1.MouseInteract := [miSelectZoom];             
end;

procedure TFormMain.ImageEnView1MouseUp(Sender: TObject; Button:
    TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  if ImageEnView1.MouseInteract = [miSelectZoom] then
  begin
    ImageEnView1.AutoShrink := False; 
    ImageEnView1.ZoomSelection();
  end;    
end;


And then I reset the Zoom with this button:

procedure TFormMain.btnImageEnViewResetAutoShrinkClick(Sender: TObject);
begin
  ImageEnView1.AutoShrink := True;
  ImageEnView1.Update;
end;


What do you think?
Go to Top of Page

w2m

USA
1990 Posts

Posted - Aug 25 2017 :  16:56:54  Show Profile  Reply
As long as it works without problems as you indicate it is ok.

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

xequte

39052 Posts

Posted - Aug 28 2017 :  03:01:41  Show Profile  Reply
Hi

In the next release (7.0.2) you will be able to set:

ImageEnView1.DisplayOptions := ImageEnView1.DisplayOptions + [iedoDisableAutoFitWhenZoom];


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