Skip to main content

TdxCustomSmartImage.Assign(TPersistent) Method

Populates the Smart Image container with an image from the specified source.

Declaration

procedure Assign(ASource: TPersistent); override;

Parameters

Name Type
ASource TPersistent

Remarks

Call this procedure to replace the Smart Image container’s content with a BMP, GIF, JPEG, PNG, TIFF, or SVG image stored in a container passed as the ASource parameter. Depending on the source container type, the Assign procedure performs different actions:

  • A Smart Image container (that is, a TdxCustomSmartImage descendant instance). Assign calls the AssignFromSmartImage procedure internally, passing the container as a parameter;

  • A custom image container (that is, a TGraphic descendant instance). Assign calls the AssignFromGraphic procedure internally, passing the container as a parameter;

  • The system clipboard (that is, a TClipboard class instance). Assign calls the PasteFromClipboard internally;

  • nil. Assign destroys the currently stored image by calling the Clear procedure.

Calling the Assign procedure raises an exception if an unsupported image container is passed as the ASource parameter.

See Also