360Works Scribbler/Documentation
WikiEditTask (Talk | contribs) m (Auto-upload documentation) |
WikiEditTask (Talk | contribs) m (Auto-upload documentation) |
||
Line 33: | Line 33: | ||
*[[#SCRIB_LicenseInfo|SCRIB_LicenseInfo]] ( ) — Returns information about the license. | *[[#SCRIB_LicenseInfo|SCRIB_LicenseInfo]] ( ) — Returns information about the license. | ||
*[[#SCRIB_Register|SCRIB_Register]] ( licenseKey ; registeredTo ) — Register the scribbler plugin. | *[[#SCRIB_Register|SCRIB_Register]] ( licenseKey ; registeredTo ) — Register the scribbler plugin. | ||
− | *[[#SCRIB_SetErrorCapture|SCRIB_SetErrorCapture]] ( errorCapture ) — | + | *[[#SCRIB_SetErrorCapture|SCRIB_SetErrorCapture]] ( errorCapture ) — Toggles error dialogs on or off. |
*[[#SCRIB_Version|SCRIB_Version]] ( ) — Returns the version number. | *[[#SCRIB_Version|SCRIB_Version]] ( ) — Returns the version number. | ||
</div> | </div> | ||
Line 144: | Line 144: | ||
<div id="SCRIB_SetErrorCapture"></div> | <div id="SCRIB_SetErrorCapture"></div> | ||
==SCRIB_SetErrorCapture ( errorCapture ) == | ==SCRIB_SetErrorCapture ( errorCapture ) == | ||
− | + | Toggles error dialogs on or off. When something unexpected happens, the plug-in will pop up a dialog displaying the error message. This makes it easy to see what went wrong. However, in some cases, you (the developer) may prefer to show your own message to the user, or possibly not show a message at all. In that case, you can call SCRIB_SetErrorCapture with a parameter of true. That will suppress the error dialog from appearing to the user. | |
<div class="parameters"><strong>Parameters:</strong> | <div class="parameters"><strong>Parameters:</strong> | ||
− | <dl></dl></div> | + | <dl><dt><code>errorCapture</code> <dd>set to true to suppress the default popups. |
+ | </dl></div> | ||
Revision as of 16:55, 22 July 2014
360Works Scribbler User Guide
Scribbler is a plugin for annotating images using mouse drawing. Typical usage involves calling the SCRIB_EditImage function, passing in the image to be edited, optional style parameters, and the name of a callback script to execute when editing is completed.
Example Usage: First, create a callback script which will be performed when the user closes the annotated image. Next, fire the following calculation:</p>
If [SCRIB_EditImage( Scribbler Example::image ; "color=#336699" ; "thickness=4.2" ; "onSave=myScript" ; # The name of the callback script "alpha=125" # A semi-transparent line )] # Scribbler opened successfully Else # Something went wrong Show Custom Dialog [ "An Error Occurred" ; SCRIB_LastError ] End If
This brings up the scribbler annotation dialog. Upon closing, the user is asked if they want to accept the changes. If he chooses "Yes
", the "myScript
" script is called with a script parameter containing the marked-up image. This annotated image can then be saved to a container field or <a href="http://360works.com/supercontainer">SuperContainer</a>.
360Works Plugin Setup Guides
See Plugins_101 for Error reporting, installation, registration, and more.
Function Summary
- SCRIB_ChooseColor ( color ) — Shows a color chooser dialog
- SCRIB_EditImage ( containerOrUrl ; scribblerData { ; key1=value1 ; key2=value2 ; ... } ) — This loads an image from a container file or URL and opens the drawing window were the image is marked up.
- SCRIB_Image ( containerOrUrl ; scribblerData ) — Renders a flattened image for scribbler data by applying markup to an image.
- SCRIB_LastError ( ) — Returns the last error generated by the scribbler plugin.
- SCRIB_LicenseInfo ( ) — Returns information about the license.
- SCRIB_Register ( licenseKey ; registeredTo ) — Register the scribbler plugin.
- SCRIB_SetErrorCapture ( errorCapture ) — Toggles error dialogs on or off.
- SCRIB_Version ( ) — Returns the version number.
Function Detail
SCRIB_ChooseColor ( color )
Shows a color chooser dialog
color
- selected color
SCRIB_EditImage ( containerOrUrl ; scribblerData { ; key1=value1 ; key2=value2 ; ... } )
This loads an image from a container file or URL and opens the drawing window were the image is marked up.
The image in question must be in gif
, png
, or jpg
format. For PDFs, you would host the PDFs on SuperContainer
and pass a RawData url to the PDF thumbnail.
Getting the Final Image
Once you close the scribbler window, Scribble will look for an onSave
callback script. If one was specified, this script will be called, and the marked-up image will be passed as a script parameter (as container data).
Optional parameters
- color
- A color value, e.g.
#003366
orRGB(0, 128, 255)
. this sets the drawing color. You could combine this with the color chooser in ScriptMaster nicely. - alpha
- this sets the drawing color alpha, which determines transparency. Must be an integer between
0
(invisible) and255
(opaque). - thickness
- a floating point number indicating the line thickness.
- fontName
- The name of the font to use for text markup, e.g "Helvetica".
- fontSize
- The size of the font to use for text markup, e.g "11".
- backgroundColor
- The background color to use for text markup items, and any other items with a background color.
- backgroundAlpha
- this sets the background color alpha, which determines transparency. Must be an integer between
0
(invisible) and255
(opaque). - showLayersList
- Whether or not to show the layers list on the left, defaults to
true
- showColorChooser
- Whether or not to show the color chooser, defaults to
false
- selectedTool
- The initially selected tool, must be one of: text, draw, move
- onSave
- the name of a script to execute when the user closes the scribbler window and approves the changes. The finished image will be passed as a script parameter.
- layerName
- the name of the newly created layer. If blank, will default to the date & time.
- x
- The x-coordinate of the window. Defaults to 100
- y
- The y-coordinate of the window. Defaults to 100
- width
- The width of the window. Defaults to the width of the image being viewed, or 1000 (whichever is smaller)
- height
- The height of the window. Defaults to the height of the image being viewed, or 700 (whichever is smaller)
- confirmSave
- Set this to zero/false to disable the save confirm dialog when the user closes a window. Setting this to false will cause "Done" and "Cancel" buttons to appear in the toolbar.
containerOrUrl
- a container field or URL pointing to the image to edit
scribblerDataOverride
- layer data from previous invocation(s) of SCRIB_EditImage, This overrides any scribbler data stored in the JPEG EXIF metadata.
params
- optional parameters
SCRIB_Image ( containerOrUrl ; scribblerData )
Renders a flattened image for scribbler data by applying markup to an image. You must specify an existing image, and scribblerData.
containerOrUrl
- a container field or URL pointing to the image to apply annotations to.
scribblerData
- layer data from previous invocation(s) of SCRIB_EditImage.
containerDataOrUrl
with scribblerData
rendered on top of it.
SCRIB_LastError ( )
Returns the last error generated by the scribbler plugin.
SCRIB_LicenseInfo ( )
Returns information about the license.
SCRIB_Register ( licenseKey ; registeredTo )
Register the scribbler plugin.
licenseKey
- your license key
registeredTo
- your company name
SCRIB_SetErrorCapture ( errorCapture )
Toggles error dialogs on or off. When something unexpected happens, the plug-in will pop up a dialog displaying the error message. This makes it easy to see what went wrong. However, in some cases, you (the developer) may prefer to show your own message to the user, or possibly not show a message at all. In that case, you can call SCRIB_SetErrorCapture with a parameter of true. That will suppress the error dialog from appearing to the user.
errorCapture
- set to true to suppress the default popups.
SCRIB_Version ( )
Returns the version number.