Return Crop Tool Position
Moderator: Kathy_9
-
Dave_SMR
- Posts: 8
- Joined: Fri Jul 29, 2016 10:08 am
- System_Drive: C
- 32bit or 64bit: 64 Bit
- motherboard: FOXCONN A76ML-K 30 1.0
- processor: Athlon II X4 640
- ram: 8GB
- Video Card: ATI Radeon 3000 Graphics
- Hard_Drive_Capacity: 250GB
- Monitor/Display Make & Model: Hanns.G HL225D x 2
- Corel programs: PSP X7 / VS X8
Return Crop Tool Position
I have a script that starts from a user set crop area, applies the crop and adds some borders. I'd like to know the offset of the defined crop area when it first runs. Is this possible?
-
LeviFiction
- Advisor
- Posts: 6831
- Joined: Thu Oct 02, 2008 1:07 pm
- 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: Return Crop Tool Position
Yes and no. Mostly no. xD Yet more fun with PSP scripting. PSP rarely has any access to current at the moment information about the state of the program. The active location of a tool for example is not known.
Now, if they have applied the crop before then you can grab the previously used settings and use those. But that's about it.
So, if you tell your user to set the crop, apply it and then undo the crop you can find out what that value was.
Now, if they have applied the crop before then you can grab the previously used settings and use those. But that's about it.
So, if you tell your user to set the crop, apply it and then undo the crop you can find out what that value was.
https://levifiction.wordpress.com/
-
Dave_SMR
- Posts: 8
- Joined: Fri Jul 29, 2016 10:08 am
- System_Drive: C
- 32bit or 64bit: 64 Bit
- motherboard: FOXCONN A76ML-K 30 1.0
- processor: Athlon II X4 640
- ram: 8GB
- Video Card: ATI Radeon 3000 Graphics
- Hard_Drive_Capacity: 250GB
- Monitor/Display Make & Model: Hanns.G HL225D x 2
- Corel programs: PSP X7 / VS X8
Re: Return Crop Tool Position
That could be useful. How do I grab those previously used values?
-
LeviFiction
- Advisor
- Posts: 6831
- Joined: Thu Oct 02, 2008 1:07 pm
- 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: Return Crop Tool Position
This is taken the AddBordersAndSelect Script.
Just change the 'TargetCmd' parameter to the command you want to get the last settings of. And Params will hold a dictionary of all of the parameters.
Code: Select all
# now call GetCommandInfo to extract the last used parameters.
Info = App.Do(Environment, 'GetCommandInfo', {
'TargetCmd': 'AddBorders',
'ParamInfo': App.Constants.ParamInfo.LastUsed
} )
# command parameters are stored in a key consisting of library name and command name
CmdParam = Info[ 'Library' ] + '\\' + Info['Name']
Params = Info[CmdParam] # get a simpler dictionary to work with
https://levifiction.wordpress.com/
