Icon Constructor (Icon, Size)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Initializes a new instance of the Icon class and attempts to find a version of the icon that matches the requested size.

Namespace:   System.Drawing
Assembly:  System.Drawing (in System.Drawing.dll)

public Icon(
	Icon original,
	Size size


Type: System.Drawing.Icon

The Icon from which to load the newly sized icon.

Type: System.Drawing.Size

A Size structure that specifies the height and width of the new Icon.

Exception Condition

The original parameter is null.

If a version cannot be found that exactly matches the size, the closest match is used. If the original parameter is an Icon that has a single size, this method only creates a duplicate icon. Use the stretching capabilities of the DrawImage method to resize the icon.

.NET Framework
Available since 1.1
Return to top