IconFrame

References
Represents a frame in an Icon.
Remarks: The IconFrame represents a single frame in an Icon. Each IconFrame can have a specific pixel size and scale, which will automatically be chosen based on the display and draw size of the image in various Eto controls. You can load an icon from an .ico, where all frames will have a 1.0 scale (pixel size equals logical size)

Constructors

IconFrame

#
public IconFrame(float scale, Bitmap bitmap)
Initializes a new instance of the IconFrame class.
scale (float)Scale of logical to physical pixels.
bitmap (Bitmap)Bitmap for the frame

IconFrame

#
public IconFrame(float scale, Func<Stream> load)
Initializes a new instance of the IconFrame class.
scale (float)Scale of logical to physical pixels.
load (Func<Stream>)Delegate to load the stream when the frame's data is required.

IconFrame

#
public IconFrame(float scale, Stream stream)
Initializes a new instance of the IconFrame class.
scale (float)Scale of logical to physical pixels.
stream (Stream)Stream for the bitmap data.

Properties

Bitmap

#
public Bitmap Bitmap { get; }
Gets the bitmap for this frame.

ControlObject

#
public object ControlObject { get; }
Gets the control object for this widget

PixelSize

#
public Size PixelSize { get; }
Gets the pixel size of the frame's bitmap

Scale

#
public float Scale { get; }
Gets the scale of this frame. 1.0 means the Size and PixelSize will be equal.
Remarks: When loading from an .ico, all frames will get a scale of 1.0.
The scale of this frame.

Size

#
public Size Size { get; }
Gets the logical size of the frame.

Methods

FromControlObject

#
public static IconFrame FromControlObject(float scale, object controlObject)
Creates an instance of the IconFrame with the specified native control object.
Remarks: This is used by platform implementations to create instances of this class with the appropriate control object. This is not intended to be called directly.
scale (float)Scale of logical to physical pixels.
controlObject (object)Native control object.
A new instance of the IconFrame with the native control object and scale.

FromResource

#
[MethodImpl(MethodImplOptions.NoInlining)] public static IconFrame FromResource(float scale, string resourceName, Assembly assembly = null)
Creates an instance of the IconFrame from an embedded resource.
scale (float)Scale of logical to physical pixels.
resourceName (string)Name of the embedded resource to load.
assembly (Assembly = null)Assembly to load the embedded resource from, or null to use the calling assembly.
A new instance.