Icon Constructor (String^, Size)
.NET Framework (current version)
Initializes a new instance of the Icon class of the specified size from the specified file.
Assembly: System.Drawing (in System.Drawing.dll)
Parameters
- fileName
-
Type:
System::String^
The name and path to the file that contains the icon data.
- size
-
Type:
System.Drawing::Size
The desired size of the icon.
| Exception | Condition |
|---|---|
| ArgumentException | The string is null or does not contain image data. |
If the specified file does not contain an image that matches the desired size, the icon that has the closest size is returned.
The fileName should include the complete path if it is not in the current application directory.
.NET Framework
Available since 2.0
Available since 2.0
Show: