updatePreview

Syntax

updatePreview(int id)

Arguments

id
The ID of the proxy preview control to be updated.

Description

updatePreview causes the proxy preview to be immediately updated with the current contents of the output image. This is useful for animating iterative algorithms in the preview window. At present, FM supports only one proxy preview, so the 'id' argument is ignored.

Example

%ffp
ForEveryTile:
{
    for( y = 0; y < Y; y++ )         // row by row
    {
        for( x = 0; x < X; x++ )     // column by column
            for( z = 0; z < Z; z++ ) // channel by channel
                pset( x, y, z, src( x % 100, y % 100, z ) + rnd( -50, 50 ) ); // apply an effect
        updateProgress( y, Y );       // update the progress bar
        updatePreview( a );           // update the preview (only in filter dialog)
    }
    return true;
}

Also see

updateProgress

Comments

Everyone can add his comments about his experiences with this function here. Tips for using it are welcome, too.