Image.importFileIcon Method

Creates an icon from the file specified by the fileName parameter by copying the icon that is used for the file.

Syntax

public int importFileIcon(str fileName)

Run On

Client

Parameters

  • fileName
    Type: str
    The name and the path of the file from which you create an icon.

Return Value

Type: int
0 indicates success; otherwise, failure.

Examples

The following example copies the icon that is used for the file test.bmp.

Image img = new Image(); 
  
img.importFileIcon(@'C:\test.bmp'); 
img.clipboardCopy(); 
// Icon used for test.bmp can now be pasted into an application.

See Also

Image Class

Image.importIcon Method