CONTENTS

How to place the applet on a web page

The editor can be placed on a web page with the tag <applet>, for example:

<applet width="640" height="480" code="Painter.class" codebase="./applet" archive="painter.jar" >
    <param name="image_width"  value="400" >
    <param name="image_height" value="300" >
    <param name="save" value="save.php" >
</applet>

Attributes

width and height Define the applet size on the page. Set them according to your page design.
codebase Specifies the directory where the applet's file painter.jar is located.
archive Specifies the applet's file and must always be painter.jar.
Don't specify the directory in this parameter, use only codebase for this purpose.
code Must always be Painter.class.

Parameters

All the applet parameters are optional. Specify them only if necessary.

 
image_width Defines the image width in pixels. Don't specify if you load an existing image.
image_height Defines the image height in pixels. Don't specify if you load an existing image.
save URL of the server script that receives the resulting image. See How to save image for details.
save_options Defines miscellaneous image save options. The following options are supported:
    width             - width of the output image
    height            - height of the output image
    format            - GIF or JPEG or PNG
    jpeg_quality      - an integer value in the range 1..100
    transparent_color - transparent color for GIF format (specified as #RRGGBB)
    superimpose       - defines what should be rendered on the saved image,
    			for example: bgimage+image+mask.
                        By default only the main image is saved.
The options should be specified as name:value pairs separated by semicolon, for example:
  <param name="save_options" value="format:JPEG; jpeg_quality:75">
blockunchanged If this parameter is set the editor doesn't allow saving unchanged pictures with the button Save. The parameter value is the message to be displayed in that case.
 
load URL of the image to load at startup. The URL can be specified as absolute or relative to the current page.
bgimage URL of the background image. If you define the background image set the image_bgcolor to transparent.
inseparable_bgimage URL of unseparable background image. This image can't be separated from the user's drawing and saved along with it.
mask URL of the mask image. The mask image is displayed on the top of the main image. Usually it has transparent areas.
load_prescaling Specifies to scale-down big images when they are loaded. The limiting parameters can be width, height or pixels and should be specified as name:value pairs separated by semicolon.
Examples:
   <!-- the image should be withing the frame 2048x1546 -->
   <param name="load_prescaling" value="width:2048; height:1536">

   <!-- the image can be of any dimension but have no more then 4 Mpixels -->
   <param name="load_prescaling" value="pixels:4M">

   <!-- the image width should not exceed 1000 and number of pixles should not exceed 10K -->
   <param name="load_prescaling" value="width:1000; pixels:10K">
image_type Image type. Can be one of the following: RGB, ARGB, BYTE_GRAY, BYTE_INDEXED, BLACK_WHITE.
image_bgcolor Background color. Use #RRGGBB format or the keyword transparent.
(the default background is #FFFFFF - white).
paint_options Defines miscellaneous paint options. The following options are supported:
anitaliasingWhether to use anialiasing. Can be true or false.
dndAllows/disallows dropping text and images from the browser to the canvas. (true or false).
snapSpecifies rounding coordinates of lines, rectangles, circles, and polygons to the specified number of pixels, e.g. snap:4
select_transparentWhen the user selects a region for copying and this option is set to true the background color the selection is converted to transparent one.

The options should be difined as name:value pairs separated by semicolon, for example:

<param name="paint_options" value="antialiasing:true; dnd:false">
 
gui The GUI scene.
language Text language file specified as URL relative to the file "painter.jar". Read more about the language file here.