updatePreview

Syntax

int updatePreview(int id)

Arguments

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

Return

Returns 1 if doingProxy (and the preview was updated), 0 otherwise.

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:
{
  // row by row
  for( y = 0; y < Y; y++ )
  {
    // column by column
    for( x = 0; x < X; x++ )
    {
      // channel by channel
      for( z = 0; z < Z; z++ )
      {

        // apply an effect
        pset( x, y, z,
          src( x % 100, y % 100, z )
          + rnd( -50, 50 ) );
      }
    }

    // update the progress bar
    updateProgress( y, Y );

    // update the preview
    // (only in filter dialog)
    updatePreview( a );

  }
  return true;
}

See Also

updateProgress

Comments

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