Click or drag to resize

BitmapWithSize Method (Int32, Int32)

Gets an Icon representation of this Bitmap scaled to draw within the specified fitting size.

Namespace:  Eto.Drawing
Assembly:  Eto (in Eto.dll) Version: 2.5.3-dev
Syntax
public Icon WithSize(
	int width,
	int height
)

Parameters

width
Type: SystemInt32
Maxiumum drawing width for the new icon.
height
Type: SystemInt32
Maxiumum drawing height for the new icon.

Return Value

Type: Icon
A new icon that will draw within the fitting size.
Remarks
This is useful when you want to draw the image at a different size than the default size without resizing the image. Note that the width and height specifies the maxiumum drawing size of the Icon, but will not change the aspect of each frame's bitmap. For example, if an existing frame is 128x128, and you specify 16x32, then the resulting frame will draw at 16x16.
See Also