![]()
|
Upgrading Paint 8 scripts to Paint 9In transition of Corel PHOTO-PAINT from version 8 to version 9, there are some drastic changes in graphic engines and as such in the way some scripting commands work. Aside from a bunch of new commands, some old ones have been changed in syntax, behavior and even the resulting effects. This might cause some difficulties when translating scripts that have worked just fine under Photo-Paint 8 to work the same way under Paint 9. I hope that this document will help you do this job easier. Let's see what was changed in Paint 9. Please note, that this document doesn't claim to be precise or complete. Text HandlingFirst, Photo-Paint 9 uses CorelDRAW's text engine and as a result, text handling is completely different now. As you might have guessed, text-related commands in scripting were changed as well. Now, in order to create a text string, you should use the following scheme:
Note that you may repeat steps 2 and 3 to add characters with different formatting into the same text object. Now let's see how to use each of these commands. TextToolSub TextTool(X AS Long, Y AS Long, RenderToMask AS Boolean,
AntiAlias AS Boolean, DrawMode AS Long)
TextSettingSub TextSetting(Arg AS String, Value AS String)
You should use this command for each individual text property. You don't have to set all the properties though. The default values will be used for properties not set explicitly. The list of available properties follows:
TextAppendSub TextAppend(Text AS String)
Appends text using predefined formatting. TextRenderSub TextRender() Renders the composed text object either as a new floating object or as mask TextEditSub TextEdit(ObjectID AS Long)
Applies changes to the specified text object. Here is an example of script that creates a text object: .TextTool 224, 47, FALSE, TRUE, 0 .TextSetting "Fill", "255,0,0" .TextSetting "Font", "Arial" .TextSetting "TypeSize", "20.000" .TextSetting "TSWeight", "4096" .TextSetting "TSUnderline", "1" .TextSetting "Justify", "2" .TextAppend "Red" .TextSetting "TSWeight", "128" .TextSetting "Fill", "0,0,255" .TextSetting "TSUnderline", "0" .TextAppend " text" .TextRender This script creates a text object containing two independent text runs: first, a word "Red" typed in red bold underlined font, and second "text" - blue plain italic. The resulting text object will look like this: Red text That covers text handling in Photo-Paint 9. Next page >> |
[ CorelSCRIPT Tips&Tricks | Learning CorelSCRIPT | Oberon Home Page ] |
|
Copyright © 2000 by Alex Vakulenko. All rights reserved.
|