ImageExtensionsToIcon(Image, Int32, Boolean) Method
Namespace: KGySoft.DrawingAssembly: KGySoft.Drawing (in KGySoft.Drawing.dll) Version: 8.1.0
public static Icon ToIcon(
this Image image,
int size,
bool keepAspectRatio
)
<ExtensionAttribute>
Public Shared Function ToIcon (
image As Image,
size As Integer,
keepAspectRatio As Boolean
) As Icon
public:
[ExtensionAttribute]
static Icon^ ToIcon(
Image^ image,
int size,
bool keepAspectRatio
)
[<ExtensionAttribute>]
static member ToIcon :
image : Image *
size : int *
keepAspectRatio : bool -> Icon
- image Image
- The image to be converted to an icon.
- size Int32
- The required width and height of the icon.
- keepAspectRatio Boolean
- When source image is not square sized, determines whether the image should keep aspect ratio.
IconAn
Icon instance created from the
image.In Visual Basic and C#, you can call this method as an instance method on any object of type
Image. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
The result icon will be always square sized and will contain only a single image.
To create a possibly non-squared icon, use the
ToIcon(Image, Color) overload or the
Icons.Combine method instead.