Page 2 of 2

Re: math for resising images for screen display

Posted: Fri Dec 18, 2015 6:13 am
by TI-994A
davido wrote:An excellent, concise, example.
Thank you very much for sharing. :D
Thanks, davido; always appreciated. :D

Re: math for resising images for screen display

Posted: Fri Dec 18, 2015 7:11 am
by fromVB
TI-994A wrote:
fromVB wrote:...why do you open the window and image gadget twice?
Thanks, fromVB. Glad you find it useful.

Rather than fiddling with desktops, the simplest approach would be to obtain the full-screen dimensions from a maximized window. This saves a lot of hassle, especially if there are multiple desktops.

However, if the image dimensions are smaller than a maximized window, the window (same window number) is re-initialised without the maximized flag, while still benefiting from the screen-centred flag. Again, this saves the hassle of fiddling with desktops to centre the window. Accordingly, if the window is re-initialised, the image gadget has to be as well.

It should also be noted that the DesktopWidth() and DesktopHeight() functions do not account for the desktop's taskbar.

Hope it answers your question. :wink:
Perfectly - thank you.

@infratec: Is there any advantage in manually positioning the window? :oops: