Image.importFileIcon Method [AX 2012]

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

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.

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.

Community Additions

ADD
Show: