Image.importFileIcon(String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.