360Works Scribbler/Documentation

From 360Works Product Documentation Wiki
(Difference between revisions)
Jump to: navigation, search
m (Auto-upload documentation)
 
m (Auto-upload documentation)
 
(One intermediate revision by one user not shown)
Line 28: Line 28:
 
<div id="toc">
 
<div id="toc">
 
*[[#SCRIB_ChooseColor|SCRIB_ChooseColor]] ( color ) &mdash; Shows a color chooser dialog
 
*[[#SCRIB_ChooseColor|SCRIB_ChooseColor]] ( color ) &mdash; Shows a color chooser dialog
*[[#SCRIB_EditImage|SCRIB_EditImage]] ( containerOrUrl ; scribblerData { ; key1=value1 ; key2=value2 ; ... } ) &mdash; This loads an image from a container file or URL and opens the drawing window were the image is marked up.
 
 
*[[#SCRIB_Image|SCRIB_Image]] ( containerOrUrl ; scribblerData ) &mdash; Renders a flattened image for scribbler data by applying markup to an image.
 
*[[#SCRIB_Image|SCRIB_Image]] ( containerOrUrl ; scribblerData ) &mdash; Renders a flattened image for scribbler data by applying markup to an image.
 
*[[#SCRIB_LastError|SCRIB_LastError]] (  ) &mdash; Returns the last error generated by the scribbler plugin.
 
*[[#SCRIB_LastError|SCRIB_LastError]] (  ) &mdash; Returns the last error generated by the scribbler plugin.
 
*[[#SCRIB_LicenseInfo|SCRIB_LicenseInfo]] (  ) &mdash; Returns information about the license.
 
*[[#SCRIB_LicenseInfo|SCRIB_LicenseInfo]] (  ) &mdash; Returns information about the license.
*[[#SCRIB_Register|SCRIB_Register]] ( licenseKey ; registeredTo ) &mdash; Register the scribbler plugin.
 
*[[#SCRIB_SetErrorCapture|SCRIB_SetErrorCapture]] ( errorCapture ) &mdash;
 
 
*[[#SCRIB_Version|SCRIB_Version]] (  ) &mdash; Returns the version number.
 
*[[#SCRIB_Version|SCRIB_Version]] (  ) &mdash; Returns the version number.
 
</div>
 
</div>
Line 45: Line 42:
 
</dl></div>
 
</dl></div>
 
<div class="see"><strong>Returns:</strong> newly selected color
 
<div class="see"><strong>Returns:</strong> newly selected color
</div>
 
 
<div id="SCRIB_EditImage"></div>
 
==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 <code>gif</code>, <code>png</code>, or <code>jpg</code> format.  For PDFs, you would host the PDFs on [http://www.360works.com/supercontainer/ SuperContainer]
 
and pass a RawData url to the PDF thumbnail.
 
<h3>Getting the Final Image</h3>
 
Once you close the scribbler window, Scribble will look for an <code>onSave</code> 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).
 
 
<h3>Optional parameters</h3>
 
<dl>
 
<!-- PENCIL STYLES -->
 
<dt>color
 
<dd>A color value, e.g. <code>#003366</code> or <code>RGB(0, 128, 255)</code>. this sets the drawing color.  You could combine this with the color chooser in ScriptMaster nicely.
 
<dt>alpha
 
<dd>this sets the drawing color alpha, which determines transparency.  Must be an integer between <code>0</code> (invisible) and <code>255</code> (opaque).
 
<dt>thickness
 
<dd>a floating point number indicating the line thickness.
 
<!-- TEXT STYLES -->
 
<dt>fontName
 
<dd>The name of the font to use for text markup, e.g &quot;Helvetica&quot;.
 
<dt>fontSize
 
<dd>The size of the font to use for text markup, e.g &quot;11&quot;.
 
<dt>backgroundColor
 
<dd>The background color to use for text markup items, and any other items with a background color.
 
<dt>backgroundAlpha
 
<dd>this sets the background color alpha, which determines transparency.  Must be an integer between <code>0</code> (invisible) and <code>255</code> (opaque).
 
<!-- BEHAVIOR STYLES -->
 
<dt>showLayersList
 
<dd>Whether or not to show the layers list on the left, defaults to <code>true</code>
 
<dt>showColorChooser
 
<dd>Whether or not to show the color chooser, defaults to <code>false</code>
 
<dt>selectedTool
 
<dd>The initially selected tool, must be one of: text, draw, move
 
<dt>onSave
 
<dd>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.
 
<dt>layerName
 
<dd>the name of the newly created layer.  If blank, will default to the date &amp; time.
 
<dt>x
 
<dd>The x-coordinate of the window.  Defaults to 100
 
<dt>y
 
<dd>The y-coordinate of the window.  Defaults to 100
 
<dt>width
 
<dd>The width of the window.  Defaults to the width of the image being viewed, or 1000 (whichever is smaller)
 
<dt>height
 
<dd>The height of the window.  Defaults to the height of the image being viewed, or 700 (whichever is smaller)
 
<dt>confirmSave
 
<dd>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.
 
</dl>
 
 
<div class="parameters"><strong>Parameters:</strong>
 
<dl><dt><code>containerOrUrl</code> <dd>a container field or URL pointing to the image to edit
 
<dt><code>scribblerDataOverride</code> <dd>layer data from previous invocation(s) of SCRIB_EditImage, This overrides any scribbler data stored in the JPEG EXIF metadata.
 
<dt><code>params</code> <dd>optional parameters
 
</dl></div>
 
<div class="see"><strong>Returns:</strong> This function returns immediately, a 1 if the image was successfully opened, or "ERROR" if something went wrong.
 
 
</div>
 
</div>
  
Line 129: Line 69:
 
</div><div class="see"><strong>Returns:</strong> license info
 
</div><div class="see"><strong>Returns:</strong> license info
 
</div>
 
</div>
 
<div id="SCRIB_Register"></div>
 
==SCRIB_Register ( licenseKey ; registeredTo ) ==
 
Register the scribbler plugin.
 
 
<div class="parameters"><strong>Parameters:</strong>
 
<dl><dt><code>licenseKey</code> <dd>your license key
 
<dt><code>registeredTo</code> <dd>your company name
 
</dl></div>
 
<div class="see"><strong>See also:</strong>  [[#SCRIB_LicenseInfo|SCRIB_LicenseInfo]]
 
</div><div class="see"><strong>Returns:</strong> 1 on successful registration, "ERROR" if registration failed.
 
</div>
 
 
<div id="SCRIB_SetErrorCapture"></div>
 
==SCRIB_SetErrorCapture ( errorCapture ) ==
 
 
 
<div class="parameters"><strong>Parameters:</strong>
 
<dl></dl></div>
 
 
  
 
<div id="SCRIB_Version"></div>
 
<div id="SCRIB_Version"></div>

Latest revision as of 10:04, 3 November 2017

Contents

[edit] 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>.


[edit] 360Works Plugin Setup Guides

See Plugins_101 for Error reporting, installation, registration, and more.

[edit] Function Summary

  • SCRIB_ChooseColor ( color ) — Shows a color chooser dialog
  • 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_Version ( ) — Returns the version number.

[edit] Function Detail

[edit] SCRIB_ChooseColor ( color )

Shows a color chooser dialog

Parameters:

color
selected color

Returns: newly selected color

[edit] 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.

Parameters:

containerOrUrl
a container field or URL pointing to the image to apply annotations to.
scribblerData
layer data from previous invocation(s) of SCRIB_EditImage.

Returns: flattened image of containerDataOrUrl with scribblerData rendered on top of it.

[edit] SCRIB_LastError ( )

Returns the last error generated by the scribbler plugin.

Returns: a textual error message, or "" if the last operation completed successfully.

[edit] SCRIB_LicenseInfo ( )

Returns information about the license.

See also: SCRIB_Register
Returns: license info

[edit] SCRIB_Version ( )

Returns the version number.

Returns: version number
Personal tools
Namespaces

Variants
Actions
Plug-in Products
Other Products
Navigation
Toolbox