PETRONODE

3.8. Extract Image Pixels

Statement extract. Extracts image from slide into a file.

    raster (x, y, dx, dy, FileName)

        x (optional) - horizontal position. Default is 0.

        y (optional) - vertical position. Default is 0.

        dx (optional) - horizontal size. Default is from the x to the slide right boundary.

        dy (optional) - vertical size. Default is from the y to the slide bottom boundary.

        FileName (mandatory) - file to write. The type is defined by extension (png, jpg, tiff, etc).


Statement countcolor. Counts colors in the area, based on the given color and tolerance.

    rasterover (x, y, dx, dy, FileName, countColor, countColorTolerance, newFile)

        x (optional) - horizontal position. Default is 0.

        y (optional) - vertical position. Default is 0.

        dx (optional) - horizontal size. Default is from the x to the slide right boundary.

        dy (optional) - vertical size. Default is from the y to the slide bottom boundary.

        FileName (mandatory) - file to write.

        cColor (optional) - colour to count in ARGB format, e.g. FFFFFFFF - white. White is a default.

        cTolerance (optional) - colour tolerance (by each component). 0 is a default.

        newFile (optional) - indicates to create a new file. False is a default (data will be appended).

The following example generates a png file with color scale example

    #

    # Example 7.

    # Demonstrates raster usage

    #

    slide (Example_07, 356, 150, png)

        bColor = FFAA00AA

    raster (50,50,256,50,Scale*.*,0,0,256,50)

    label (50,10,256,30)

        Text =Palette Example

        fSize = 16

        lSize = 2

        tPosition = center

The resulting image is like this:

Example_07