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

pierrotsc

USA
497 Posts

Posted - Aug 06 2019 :  13:55:17  Show Profile  Reply
If i maximize my application and i want to have my image to keep the same magnification, how would i do that ? The imageenview gets a lot bigger.
thanks

xequte

38182 Posts

Posted - Aug 07 2019 :  03:08:45  Show Profile  Reply
Hi

The magnification (Zoom property) of ImageEnView does not change by default, perhaps you have set one of the auto-zooming properties such as AutoShrink or AutoStretch.


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

pierrotsc

USA
497 Posts

Posted - Aug 07 2019 :  08:36:04  Show Profile  Reply
Indeed, it does not change. let me rephrase. If i have my image that fills the screen right now and I maximize, it will not fill the screen anymore. That means if i had a magnification of x, could i get the same x magnification when i maximize or minimize ? Am i making sense ?
Go to Top of Page

xequte

38182 Posts

Posted - Aug 07 2019 :  15:37:28  Show Profile  Reply
Hi

I'm not sure I'm following, but you can use the Fit command to make an image fill the screen, or read then write VisibleBitmapRect to make the same area of image show again.

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

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

pierrotsc

USA
497 Posts

Posted - Aug 07 2019 :  15:42:23  Show Profile  Reply
Let me try one more time :) if i have an image that has a 30 % zoom on an imageenview window, it takes up to 30% of the space. now if i maximize, the image does not adapt to fill the new space at 30%. it will look like more 10 or 15 %. Not sure if am am still making sense. it looks like i may hvae to use the onviewchange event or something like that.
Go to Top of Page

xequte

38182 Posts

Posted - Aug 07 2019 :  18:32:21  Show Profile  Reply
Hi

Then VisibleBitmapRect should work (if image is larger than view), or just maths:

Zoom := Previous_Zoom * New_Size / Old_Size;

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

pierrotsc

USA
497 Posts

Posted - Aug 07 2019 :  20:16:31  Show Profile  Reply
ok, should i put that in the imagenview event or the form resize event ?
Go to Top of Page

xequte

38182 Posts

Posted - Aug 07 2019 :  22:51:17  Show Profile  Reply
Hi

TImageEnView.OnResize would be best.

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

pierrotsc

USA
497 Posts

Posted - Aug 08 2019 :  11:28:26  Show Profile  Reply
The VisibleBitmapRec does not vibe me what i want so i need to use the math. the only thing is on how would i know the current zoom value before i maximize or minimize the form ?

To tell you the truth i just need to know the old zoom value and re apply it to the maximized or minimized form. I assume that would do it.
Go to Top of Page

xequte

38182 Posts

Posted - Aug 08 2019 :  22:08:00  Show Profile  Reply
Hi

Controls have no "Before Sizing" event, so you will need to maintain a private variable to store it (e.g. setting it at the end of the ImageEnView ViewChange event.

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

pierrotsc

USA
497 Posts

Posted - Aug 09 2019 :  08:50:25  Show Profile  Reply
ok...will try that. Thank you
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: