public static Icon ToIcon(
this Image image,
Color transparentColor = default
)
<ExtensionAttribute>
Public Shared Function ToIcon (
image As Image,
Optional transparentColor As Color = Nothing
) As Icon
public:
[ExtensionAttribute]
static Icon^ ToIcon(
Image^ image,
Color transparentColor = Color()
)
[<ExtensionAttribute>]
static member ToIcon :
image : Image *
?transparentColor : Color
(* Defaults:
let _transparentColor = defaultArg transparentColor new Color()
*)
-> Icon
The result icon will have the same size as the specified image. To create a squared icon, use the ToIcon(Image, Int32, Boolean) overload instead.
If the raw format of image is an icon that contains multiple images, then the result will also contain multiple resolutions.
The result Icon is compatible with Windows XP if the method is executed in a Windows XP environment.
To disable PNG compression also for large images regardless of the current operating system call the Combine(Bitmap, Color, Boolean) method instead.