imageToFile()

Stores an images which was created using getPanelPreview() (or using QVarPicture) to a file on the disk.

Synopsis

int imageToFile(const anytype &image, string fileName);

Parameters

Parameter Meaning
image Image to be stored in the file.
fileName Name of the file where the image should be stored. If no extension was specified, the image is stored in *.png format. Otherwise the file format is determined on the basis of the available extension.

Return value

In case of error -1, otherwise 0.

Description

Stores an images which was created using getPanelPreview() (or using QVarPicture) to a file on the disk.

Example

Creates a preview of the panel "foobar" inside a pictureflow widget and saves the preview picture as "example.jpg".

main()
{
  this.slideSize = makeDynInt(200, 150);
  anytype image;
  getPanelPreview(image, "foobar.pnl", 0.5, true, true);
  this.addSlide(image);
  imageToFile(image,"example.jpg");
}

Assignment

Data point functions

Availability

UI