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
 How do I make a selection zoom in when I click on
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

save0804

Korea
20 Posts

Posted - Mar 06 2019 :  21:04:00  Show Profile  Reply
How do I select an image as a miselect and zoom in by clicking on the selection?











xequte

38616 Posts

Posted - Mar 06 2019 :  22:57:49  Show Profile  Reply
Hi

You can use:
// Zoom into the selected area of the image
procedure TMainForm.Button1Click(Sender: TObject);
var
  sel: TIERectangle;
begin
  if ImageEnView1.Selected then
  begin
    sel := ImageEnView1.SelectedRect;
    ImageEnView1.VisibleBitmapRect := Rect( sel.x, sel.y, sel.x + sel.width, sel.y + sel.height );
  end;
end;


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

save0804

Korea
20 Posts

Posted - Mar 06 2019 :  23:36:10  Show Profile  Reply

I want to zoom in when I click on a selection area like in a photo.

Go to Top of Page

xequte

38616 Posts

Posted - Mar 07 2019 :  02:11:29  Show Profile  Reply
Hi

The whole code would be something like:

procedure TMDIChild.ImageEnView1MouseDown(Sender: TObject; Button: TMouseButton;
                                          Shift: TShiftState; X, Y: Integer);
var
  sel: TIERectangle;
begin
  if ImageEnView1.Selected and
     ( ImageEnView1.XScr2Bmp( X ) > ImageEnView1.SelX1 ) and
     ( ImageEnView1.YScr2Bmp( Y ) > ImageEnView1.SelY1 ) and
     ( ImageEnView1.XScr2Bmp( X ) < ImageEnView1.SelX2 ) and
     ( ImageEnView1.YScr2Bmp( Y ) < ImageEnView1.SelY2 ) then
  begin
    sel := ImageEnView1.SelectedRect;
    ImageEnView1.VisibleBitmapRect := Rect( sel.x, sel.y, sel.x + sel.width, sel.y + sel.height );
  end;
end;


Also, there is a MouseInteract items that performs a similar function: miSelectZoom.

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