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
 Select and Zoom
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

brm121966

USA
53 Posts

Posted - Aug 06 2022 :  14:16:12  Show Profile  Reply
Hello.
Spent some time on the ImageEnView.select method to calculate the center of an image with different zoom values. But I could not set the image selection area to the center.
Please, tell me how to correctly calculate the center of the image to select an area of 100 by 100 pixels using ImageEnView.select and zoom 50...120.
Thank you.

Rudolf

xequte

38180 Posts

Posted - Aug 07 2022 :  18:24:41  Show Profile  Reply
Hi Rudolf

It should be easy if you set the SelectionBase to the image:

https://www.imageen.com/help/TImageEnView.SelectionBase.html

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

brm121966

USA
53 Posts

Posted - Aug 08 2022 :  22:14:48  Show Profile  Reply
Hi Nigel.
Thank you. It's very simple.
Please tell me how to select a square with rounded edges.
Thank you.

Rudolf
Go to Top of Page

brm121966

USA
53 Posts

Posted - Aug 09 2022 :  21:34:33  Show Profile  Reply
Hi Nigel.
I'm sorry to trouble you.
You can't just resize the selection.
I decrease the size of the Y2 square selection by 1 pixel, and X2 is recalculated by 2.

begin
with ImageEnView do begin
SelectionBase := iesbBitmap;
Select(SelX1,SelY1,SelX2,SelY2-1);
end;
end;

Am I doing it wrong?

Thank you.

Thank you.

Rudolf
Go to Top of Page

xequte

38180 Posts

Posted - Aug 09 2022 :  23:48:39  Show Profile  Reply
Hi Rudolf

You resize the selection by using the mouse?

What is ImageEnView1.Zoom?

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

brm121966

USA
53 Posts

Posted - Aug 10 2022 :  06:53:52  Show Profile  Reply
Hi Nigel.
I'm trying to programmatically change the size of the frame of the selected area. Here is the code

...ButtonClick....
begin
with ImageEnView do begin
SelectionBase := iesbBitmap;
Select(SelX1,SelY1,SelX2,SelY2-1);
end;
end;
Checked with different Zoom 80 - 120.

The selected area frame changes normally using the mouse.

Thank you.
Rudolf
Go to Top of Page

xequte

38180 Posts

Posted - Aug 17 2022 :  23:16:44  Show Profile  Reply
Hi Rudolf

As per the Select() documentation, x2 and y2 are exclusive values (those pixels are not included in the selection).

Whereas for SelX2 and SelY2 the values are inclusive.

I will add a better description to the documentation to make it clearer.

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

brm121966

USA
53 Posts

Posted - Aug 21 2022 :  14:11:17  Show Profile  Reply
Thanks.

Rudolf
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: