Groups > Corel > Corel Paint Shop Pro Scripting > Re: Script to draw a rectangle




Script to draw a rectangle

Script to draw a rectangle
Sat, 23 Feb 2008 10:48:08 -060
I've been experimenting with using a drawn rectangle on a vector layer 
instead of using the 'image>border' command. The border must be part of the 
background layer and interferes with any editing (is included in edits) 
unless I finish with all the post work and then merge the layers and then 
add the border. This means keeping a couple versions of each image I want to 
print, with and without borders. With a vector rectangle I can turn the 
level on or off as needed. The problem I have is getting the rectangle 
perfectly aligned with the image corner which prints as an uneven line and I 
have to do the selection and placement for each image.

Would anyone point me to an already existing script that will set a 
rectangle to the corners of any size image, and allow an interactive option 
to change the line thickness after it has been drawn (after looking at the 
bordered image, sometimes I want a slightly thicker frame.

TIA

Harv 

Post Reply
Re: Script to draw a rectangle
Sat, 23 Feb 2008 14:29:18 -050
I'im not sure if this will do the trick for you, Harv, as you don't give 
enough information about what you want.  However, this script will add a 
vector border to an image (as the TOP layer in the image), starting in the 
top left corner, and going to the bottom right corner.  The user is asked 
for the WIDTH of the border, which is currently added in WHITE.  Once the 
border is added to the image, the Vector Property dialog pops up, allowing 
the user to change the width and/or color of the border.
This script should work in any version of PSP.  Let me know if this is what 
you want, Harv.  Suz
color's free wrote:
> I've been experimenting with using a drawn rectangle on a vector layer
> instead of using the 'image>border' command. The border must be part
> of the background layer and interferes with any editing (is included
> in edits) unless I finish with all the post work and then merge the
> layers and then add the border. This means keeping a couple versions
> of each image I want to print, with and without borders. With a
> vector rectangle I can turn the level on or off as needed. The
> problem I have is getting the rectangle perfectly aligned with the
> image corner which prints as an uneven line and I have to do the
> selection and placement for each image.
>
> Would anyone point me to an already existing script that will set a
> rectangle to the corners of any size image, and allow an interactive
> option to change the line thickness after it has been drawn (after
> looking at the bordered image, sometimes I want a slightly thicker
> frame.
>
> TIA
>
> Harv 
Post Reply
Re: Script to draw a rectangle
Sat, 23 Feb 2008 15:41:18 -070
"SuzShook" <suzshook@roadrunner.com> wrote in
news:47c09dbf_3@cnews:

> Another way to edit the line width is to make the "Rectangle"
sublayer
> the active layer and choose Objects...Properties.
> 

Actually, it's even easier to just double-click the Rectangle sublayer, 
which will bring up the Vector Property dialogue.

But you forgot to post the modified script for him :-)

Regards,

Post Reply
Re: Script to draw a rectangle
Sat, 23 Feb 2008 16:20:27 -060
Suz, the script works! I wanted a black line for a border that I can adjust 
the width of and not futz around trying to find the corners of my image, and 
that is just what your script does.  Is there a way to edit the line width 
after the script has run, other than deleting the layer and rerunning the 
script?

Harv

"SuzShook" <suzshook@roadrunner.com> wrote in message 
news:47c073c4$1_2@cnews...
> I'im not sure if this will do the trick for you, Harv, as you don't give 
> enough information about what you want.  However, this script will add a 
> vector border to an image (as the TOP layer in the image), starting in the

> top left corner, and going to the bottom right corner.  The user is asked 
> for the WIDTH of the border, which is currently added in WHITE.  Once the 
> border is added to the image, the Vector Property dialog pops up, allowing

> the user to change the width and/or color of the border.
>
> This script should work in any version of PSP.  Let me know if this is 
> what you want, Harv.  Suz
>
> color's free wrote:
>> I've been experimenting with using a drawn rectangle on a vector layer
>> instead of using the 'image>border' command. The border must be
part
>> of the background layer and interferes with any editing (is included
>> in edits) unless I finish with all the post work and then merge the
>> layers and then add the border. This means keeping a couple versions
>> of each image I want to print, with and without borders. With a
>> vector rectangle I can turn the level on or off as needed. The
>> problem I have is getting the rectangle perfectly aligned with the
>> image corner which prints as an uneven line and I have to do the
>> selection and placement for each image.
>>
>> Would anyone point me to an already existing script that will set a
>> rectangle to the corners of any size image, and allow an interactive
>> option to change the line thickness after it has been drawn (after
>> looking at the bordered image, sometimes I want a slightly thicker
>> frame.
>>
>> TIA
>>
>> Harv
>
>
> 

Post Reply
Re: Script to draw a rectangle
Sat, 23 Feb 2008 17:26:36 -050
Here's a version that makes a BLACK border rather than a white border.  And 
yes, you can edit the line width after the script terminates by 
right-clicking on the "Rectangle" object, or sublayer of the
BorderLayer 
layer in the Layer palette, and choosing Properties from the context menu. 
That will bring up that same Vector Property dialog that comes up at the end 
of the script.  Glad it works for you, Harv.  Suz

color's free wrote:
> Suz, the script works! I wanted a black line for a border that I can
> adjust the width of and not futz around trying to find the corners of
> my image, and that is just what your script does.  Is there a way to
> edit the line width after the script has run, other than deleting the
> layer and rerunning the script?
>
> Harv
>
> "SuzShook" <suzshook@roadrunner.com> wrote in message
> news:47c073c4$1_2@cnews...
>> I'im not sure if this will do the trick for you, Harv, as you don't
>> give enough information about what you want.  However, this script
>> will add a vector border to an image (as the TOP layer in the
>> image), starting in the top left corner, and going to the bottom
>> right corner.  The user is asked for the WIDTH of the border, which
>> is currently added in WHITE.  Once the border is added to the image,
>> the Vector Property dialog pops up, allowing the user to change the
>> width and/or color of the border. This script should work in any
version 
>> of PSP.  Let me know if this
>> is what you want, Harv.  Suz
>>
>> color's free wrote:
>>> I've been experimenting with using a drawn rectangle on a vector
>>> layer instead of using the 'image>border' command. The border
must
>>> be part of the background layer and interferes with any editing
(is
>>> included in edits) unless I finish with all the post work and then
>>> merge the layers and then add the border. This means keeping a
>>> couple versions of each image I want to print, with and without
>>> borders. With a vector rectangle I can turn the level on or off as
>>> needed. The problem I have is getting the rectangle perfectly
>>> aligned with the image corner which prints as an uneven line and I
>>> have to do the selection and placement for each image.
>>>
>>> Would anyone point me to an already existing script that will set
a
>>> rectangle to the corners of any size image, and allow an
interactive
>>> option to change the line thickness after it has been drawn (after
>>> looking at the bordered image, sometimes I want a slightly thicker
>>> frame.
>>>
>>> TIA
>>>
>>> Harv 

Post Reply
<< Previous 1 2 Next >>
( Page 1 of 2 )
about | contact