Partilhar via


Image.importFileIcon(String) Method

Definition

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

public:
 virtual int importFileIcon(System::String ^ _fileName);
public virtual int importFileIcon (string _fileName);
abstract member importFileIcon : string -> int
override this.importFileIcon : string -> int
Public Overridable Function importFileIcon (_fileName As String) As Integer

Parameters

_fileName
String

The name and the path of the file from which you create an icon.

Returns

0 indicates success; otherwise, failure.

Remarks

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.

Applies to