Sign in Join
FPDoc Onlineexperiment

TGraphic.LoadFromFile procedure

Member of TGraphicpublicIn unit Graphics

Reads data for the graphic from a file.

Declaration

pascal
procedure LoadFromFile(const Filename: string); virtual

Arguments

Filename

The name of the file containing the graphic data.

Description

LoadFromFile reads data for the graphic from the local file system. FileName contains the name of the file on the local file system with data for the graphic, and may contain UTF-8-encoded characters in the file name.

LoadFromFile creates a temporary TFileStreamUTF8 instance that is used to read the contents of the file by calling LoadFromStream. Any existing image data in the class instance is discarded. An Exception can be raised in LoadFromStream if Filename does not contain a valid file name.

Errors

Raises an Exception if an invalid file name is passed to the method.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.