Sign in Join
FPDoc Onlineexperiment

TOpenPictureDialog.UpdatePreview procedure

Member of TOpenPictureDialogprotectedIn unit ExtDlgs

Loads the preview image for the current file name, or clears the preview image when the file is not usable.

Declaration

pascal
procedure UpdatePreview; virtual

Description

UpdatePreview is a procedure used to update the preview image file name and the image caption for the open picture dialog. The preview image file name is based on the current value in the FileName property. No actions are performed in the method if the preview image file name already contains the value in FileName.

FileName must be a valid qualified path on the local file system, and have read permissions. The image file is loaded into the ImageCtrl on the dialog. The caption in PictureGroupBox is updated to display the Width and Height for the stored image in the format '(%dx%d)' (Width x Height).

The ClearPreview method is called if the file path or name is not valid, not successfully loaded (due to permissions or image format), or the PictureGroupBox is not used for the platform (as with Windows Vista and later versions where the preview image is natively supported).

UpdatePreview is called from the DoSelectionChange method when the selected file name for the preview dialog has changed. It is executed before an assigned OnSelectionChange event handler for the dialog.

See also

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