Upgrading Paint 8 scripts to Paint 9

<< Previous Page

Object Handling

Corel Photo-Paint 9 has improved object handling procedures which allow to apply some transformations to several objects at once.

To accommodate this functionality, most of ObjectNNN scripting commands were extended to support multi-object targets. These commands now require EndObject command to finish the clause. You can put ObjectSelectNone and ObjectSelect statements in between to specify which objects to apply transformations to.

For example, to move object 1 and 2, you should use:

.ObjectTranslate
	.ObjectSelectNone
	.ObjectSelect 1, True
	.ObjectSelect 2, True
	.EndObject

If you do not specify ObjectSelect statements, the operation is performed on the currently selected objects.

However there are some ObjectNNN commands that do not need EndObject command. These are commands that do not work with selected objects. They work with a specific object.

Here is the list of all ObjectNNN command that require EndObject and those which don't:

Requires EndObject: Does not need EndObject:
ObjectAddClipMask
ObjectAddClipMaskFromMask
ObjectAddClipMaskFromTransparency
ObjectAffineDistort
ObjectAlign
ObjectClip
ObjectCombine
ObjectCreate (*1)
ObjectDefringe
ObjectDelete
ObjectDistort
ObjectDropShadow
ObjectDropShadowCombine
ObjectDropShadowDelete
ObjectDropShadowSplit
ObjectDuplicate
ObjectFeather
ObjectFlipHorizontal
ObjectFlipVertical
ObjectGroup
ObjectMerge
ObjectMergeMode
ObjectName
ObjectOpacity
ObjectOrder
ObjectRemoveClipMask
ObjectRemoveMatte
ObjectRotate
ObjectSelection (*2)
ObjectSkew
ObjectStretch
ObjectThreshold
ObjectTranslate
ObjectUngroup
ObjectClipToParent
ObjectEdit
ObjectEditTransparency
ObjectVisible
ObjectOrderChange
ObjectProperties
ObjectNew
ObjectToggleClipMask
ObjectToggleLinkClipMask
ObjectColorTransparencyTool (*3)
ObjectCreateFromBackground
ObjectSelectAll
ObjectSelectNone
ObjectSelect
ObjectTagWWWURL (*4)
ObjectURLInfo
ObjectTransparencyTool (*5)

Notes:

*1 - ObjectCreate accepts SetPaperColor command between ObjectCreate and EndObject to set the background color of the cut region.

*2 - ObjectSelection is meant to just select given objects without performing any actions on them. Unfortunately due to a bug, this command doesn't work

*3 - ObjectColorTransparencyTool requires EndObjectColorTransparencyTool to close the command, rather than EndObject

*4 - ObjectTagWWWURL should be closed with EndObjectTagWWWURL, not EndObject

*5 - ObjectTransparencyTool should be closed with EndObjectTransparencyTool rather than EndObject.

Also note, that ObjectDropShadow has different arguments than in Paint 8:

Sub ObjectDropShadow(Mode AS Boolean, Direction AS Long, Distance AS Long, 
                Feather AS Long, Type AS Long, Edges AS Long, Opacity AS Long, 
                Relative AS Boolean, Fade AS Long, Anchor AS Long, Stretch AS Double, 
                ColorModel AS Long, Color1 AS Long, Color2 AS Long, Color3 AS Long, 
                Color4 AS Long)

MaskCreate command

MaskCreate command now requires EndMaskCreate to close the command. ObjectSelectNone and ObjectSelect can be used in between to specify which objects to use to build a new mask...

Effect changes

Along with numerous new bitmap effects introduced in Photo-Paint 9, there are some changes to existing effects. You should keep this in mind when translating old scripts to version 9.

Here is the list of changed commands (see this document for more information about changed commands in Photo-Paint 9):

  • EffectAddNoise: adds extra color parameters. In addition to this, the Noise effect produces much fainter effect, so you might consider adding several EffectAddNoise commands to create more intense effect.
  • EffectImpressionist: renamed to EffectScatter. EffectImpressionist now represents different effect
  • EffectRadialBlur: Mode argument is removed
  • EffectSharpen: Background parameter is removed
  • EffectTheBoss: new Invert parameter added
  • EffectUserDefined: new Intensity parameter added
  • FadeLastCommand: now have two parameters - Percent and MergeMode.

Other changes

Some other commands have been also changed:

  • ImageConvert: two new parameters (Intensity and Flatten) added.
  • ImageConvertDuotone: new parameter Flatten added
  • ImageConvertPaletted: two new parameters (Intensity and Flatten) added.
  • MaskFloaterMoveTo: background color parameters added.
  • ObjectAlign: spacing parameters (ObjectSpacing, XSpacing, and YSpacing) added
  • PathNode: X and Y parameters are now Doubles.

If you noticed some other compatibility issues when transferring Paint 8 scripts to Paint 9 platform, please let me know. Any comments are greatly appreciated.


[ CorelSCRIPT Tips&Tricks | Learning CorelSCRIPT | Oberon Home Page ]

Copyright © 2000 by Alex Vakulenko. All rights reserved.
This page was last revised on 02/27/00.