Zoom behaviour

Corel Paint Shop Pro

Moderator: Kathy_9

Post Reply
ilgk48
Posts: 63
Joined: Sun Apr 28, 2019 12:26 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PaintShop PRO 2019 32bit

Zoom behaviour

Post by ilgk48 »

God afternoon,
I'm playing with a simple script that calls "Zoom" but I do not completely realize how act the parameters "Rectangle" and "Center Point".
An explanation will be very appreciated :-).
Thank you.
Paolo
LeviFiction
Advisor
Posts: 6831
Joined: Thu Oct 02, 2008 1:07 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Alienware M17xR4
processor: Intel Core i7-3630QM CPU - 2_40GH
ram: 6 GB
Video Card: NVIDIA GeForce GTX 660M
sound_card: Sound Blaster Recon3Di
Hard_Drive_Capacity: 500GB
Corel programs: PSP: 8-2023
Location: USA

Re: Zoom behaviour

Post by LeviFiction »

I've never used it myself as it's not useful for any of my own scripts but a quick test shows these possible rules.

1) Rectangle is only used if you want to ensure a specific area of the image is in view. If you use Rectangle set Percent to 0 and Center point to (0,0) as they won't be used. PSP will figure out the zoom percentage based on the rectangle you chooose.

If you're doing anything else always set the rectangle to ((0,0), 0,0)

2) If you're zooming in set the percentage to what you want, and set the center point to where you want the zoom to focus on the image. I'm assuming that if you're zooming in on the image in the script you know where you want the zoom to be looking. It's just a tuple of x,y coordinates somewhere on the image. (x,y) for example zooming in with center point (500,500) on a 1000x1000 pixel image will zoom in keeping the image centered.

3) If you're zooming out, set the center point to (0,0) as it won't matter, and set the percentage to a lower value.
https://levifiction.wordpress.com/
ilgk48
Posts: 63
Joined: Sun Apr 28, 2019 12:26 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PaintShop PRO 2019 32bit

Re: Zoom behaviour

Post by ilgk48 »

OK :-)
I've just merged your suggestions with my experiments but still i do not obtain, from Zoom, exactly what I wish.
What I wish is:
1) there is an image scanned from an A4 sheet; the image is the page of a magazine and contains some pics;
2) the image is set "zoom to fit"
3) I select a pic with a rectangular selection;
4) then I zoom (with a script) for a better view and after resizing the selection using another script (damn: PSP permits only the redrawing of the selection);

Well: not always, after zooming, the selection is entirely in the scope of the window of PSP and so I have to adjust with the scrollbars: but I do not want to use the scrollbars at all, because in the economy of my job this scroll is annoying!!!

Paolo
LeviFiction
Advisor
Posts: 6831
Joined: Thu Oct 02, 2008 1:07 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Alienware M17xR4
processor: Intel Core i7-3630QM CPU - 2_40GH
ram: 6 GB
Video Card: NVIDIA GeForce GTX 660M
sound_card: Sound Blaster Recon3Di
Hard_Drive_Capacity: 500GB
Corel programs: PSP: 8-2023
Location: USA

Re: Zoom behaviour

Post by LeviFiction »

I'm sorry but I don't understand the issue. First, PSP does allow you to resize selections but you have to do it in Edit Selection mode. It doesn't have a shortcut key attached to it but you can add one in the Customize dialog if you think you'll be using it often. Put down a selection, turn on Edit Selection mode then use the pick tool to resize the selection.

If you don't want to zoom in too far, then change the selection rectangle to not zoom in too far. Give yourself room. You're the one in control of where and how far the zoom attempts to go when using scripting.
https://levifiction.wordpress.com/
ilgk48
Posts: 63
Joined: Sun Apr 28, 2019 12:26 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PaintShop PRO 2019 32bit

Re: Zoom behaviour

Post by ilgk48 »

Hi LeviFiction,
always nice and competent. Thank you.
Regarding the resize, point 4) is badly written. Better:
... after selecting ...
4) I Zoom (with a script) for a better and magnified view of the selection and, if necessary, I do a fine tuning of it using another script .

This script is just my personal shortcut and it acts exactly as I want: no keyboard and minimal flying of the mouse over the image (my right hand is happy :-) ). Ok, this requires a toolbar with eight button, but to me it is perfect for expanding or collapsing the sides of the rectangle. The amount (in pixels) of the expanding/collapsing is stored in a dictionary that i manage with a simple Form (tkinter).

Returning to Zoom I am not sure of understanding your suggestion. If it helps, the rectangle of Zoom should be the rectangle of my selection and I wish to zoom the image (applying a sort of automatic panning) so that the entire selection is displayed in the window in "one shot". But I'm missing something ...

Thank you again.
LeviFiction
Advisor
Posts: 6831
Joined: Thu Oct 02, 2008 1:07 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Alienware M17xR4
processor: Intel Core i7-3630QM CPU - 2_40GH
ram: 6 GB
Video Card: NVIDIA GeForce GTX 660M
sound_card: Sound Blaster Recon3Di
Hard_Drive_Capacity: 500GB
Corel programs: PSP: 8-2023
Location: USA

Re: Zoom behaviour

Post by LeviFiction »

Okay a few more tests, Zoom doesn't do a great job of panning. It's mostly just for zooming in. It'll try and pan near or around the rectangle but it's more concerned with the zoom percentage. If the rectangle you specify is visible and the zoom percentage is the same as before it won't pan at all, while zooming in it'll pan a little but it will never center itself around the rectangle. You can use the Pan tool to move the image trying to maintain the center after you resize the selection. You know how many pixels it moves to increase the selection but it'll be imprecise.

I don't think there's a good way to do what you want, or if there is I don't know what it is. PSP's scripting is meant to make repetitive tasks easier, they haven't really focused on how the UI works or updates with scripts. We get very little control over that and what control we do get is because of the tools available. The zoom is usually correct within about a few percentage points. If we had a good way to get the percentage and the current scroll location we could force PSP to use the pan tool and zoom tool to get close. But I know of no way to do that.
https://levifiction.wordpress.com/
ilgk48
Posts: 63
Joined: Sun Apr 28, 2019 12:26 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PaintShop PRO 2019 32bit

Re: Zoom behaviour

Post by ilgk48 »

I too did some tests.
I have neglected the use of the rectangle and tried to understand the behaviour of the combination Percent - Center Point.
Well, I have empirically found that the Center Point (at least in my operative conditions) remains stuck in a fixed point of the window.
This solves my problem :-).
LeviFiction
Advisor
Posts: 6831
Joined: Thu Oct 02, 2008 1:07 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Alienware M17xR4
processor: Intel Core i7-3630QM CPU - 2_40GH
ram: 6 GB
Video Card: NVIDIA GeForce GTX 660M
sound_card: Sound Blaster Recon3Di
Hard_Drive_Capacity: 500GB
Corel programs: PSP: 8-2023
Location: USA

Re: Zoom behaviour

Post by LeviFiction »

Awesome, glad you found a solution.
https://levifiction.wordpress.com/
Post Reply