public static Icon Resize(
this Icon icon,
Size size
)<ExtensionAttribute>
Public Shared Function Resize (
icon As Icon,
size As Size
) As Iconpublic:
[ExtensionAttribute]
static Icon^ Resize(
Icon^ icon,
Size size
)[<ExtensionAttribute>]
static member Resize :
icon : Icon *
size : Size -> Icon If the icon contains images with the specified size, then this method just extracts the highest bit-per-pixel image of the requested size.
If the icon does not contain an image exactly with the specified size, then this method takes a close image in size and resizes that to the requested size. If resizing happens, the result will always contain a 32 bpp image.
If an actual resize is needed, this overload uses Graphics.DrawImage internally. It provides a good quality result on Windows, but it also blocks every parallel DrawImage call within the same process. On non-Windows platforms (e.g. when the operation is backed by libgdiplus) the quality of the result can be quite poor. If these can be issues, use the Resize(Icon, Size, ScalingMode) overload instead.