C# Class Eto.Drawing.Icon

Inheritance: Image
Show file Open project: picoe/Eto Class Usage Examples

Private Properties

Property Type Description
FindByScale IconFrame
FindBySize IconFrame
GetResources IEnumerable

Public Methods

Method Description
FromResource ( string resourceName, Assembly assembly = null ) : Icon

Loads an icon from an embedded resource of the specified assembly

FromResource ( string resourceName, Type type ) : Icon

Loads an icon from a resource in the same assembly as the specified type

GetFrame ( float scale, Eto.Drawing.Size fittingSize = null ) : IconFrame

Gets the frame with the specified scale that can fit into the fittingSize if specified.

This can be used to determine which frame should be used to draw to the screen, based on the desired logical pixel scale and final drawn size of the icon.

Icon ( ) : System

Initializes a new instance of the Eto.Drawing.Icon class with the specified frames.

This is used when you want to create an icon with specific bitmap frames at different scales or sizes.

Icon ( IEnumerable frames ) : System

Initializes a new instance of the Eto.Drawing.Icon class with the specified frames.

This is used when you want to create an icon with specific bitmap frames at different scales or sizes.

Icon ( IHandler handler ) : System

Initializes a new instance of the Icon class with the specified handler

Icon ( Stream stream ) : System

Initializes a new instance of the Icon class with the contents of the specified stream

Icon ( float scale, Bitmap bitmap ) : System

Initializes a new instance of the Eto.Drawing.Icon class with the specified bitmap.

This is used when you want to create an icon with a single bitmap frame with the specified logical scale.

Icon ( string fileName ) : System

Intitializes a new instanc of the Icon class with the contents of the specified fileName

Private Methods

Method Description
FindByScale ( float scale ) : IconFrame

find based on scale alone, we don't know the final render size

FindBySize ( float scale, Eto.Drawing.Size fittingSize ) : IconFrame

Find based on the fitting pixel size

GetResources ( string resourceName, Assembly assembly ) : IEnumerable

Method Details

FromResource() public static method

Loads an icon from an embedded resource of the specified assembly
public static FromResource ( string resourceName, Assembly assembly = null ) : Icon
resourceName string Fully qualified name of the resource to load
assembly System.Reflection.Assembly Assembly to load the resource from
return Icon

FromResource() public static method

Loads an icon from a resource in the same assembly as the specified type
public static FromResource ( string resourceName, Type type ) : Icon
resourceName string Full name of the resource in the type's assembly.
type System.Type Type of the assembly to get the resource.
return Icon

GetFrame() public method

Gets the frame with the specified scale that can fit into the fittingSize if specified.
This can be used to determine which frame should be used to draw to the screen, based on the desired logical pixel scale and final drawn size of the icon.
public GetFrame ( float scale, Eto.Drawing.Size fittingSize = null ) : IconFrame
scale float Logical scale to find for, 1 for normal size, 2 for retina, etc.
fittingSize Eto.Drawing.Size Fitting size that the icon will be drawn to, if known.
return IconFrame

Icon() public method

Initializes a new instance of the Eto.Drawing.Icon class with the specified frames.
This is used when you want to create an icon with specific bitmap frames at different scales or sizes.
public Icon ( ) : System
return System

Icon() public method

Initializes a new instance of the Eto.Drawing.Icon class with the specified frames.
This is used when you want to create an icon with specific bitmap frames at different scales or sizes.
public Icon ( IEnumerable frames ) : System
frames IEnumerable Frames for the icon.
return System

Icon() public method

Initializes a new instance of the Icon class with the specified handler
public Icon ( IHandler handler ) : System
handler IHandler Handler for the icon backend
return System

Icon() public method

Initializes a new instance of the Icon class with the contents of the specified stream
public Icon ( Stream stream ) : System
stream Stream Stream to load the content from
return System

Icon() public method

Initializes a new instance of the Eto.Drawing.Icon class with the specified bitmap.
This is used when you want to create an icon with a single bitmap frame with the specified logical scale.
public Icon ( float scale, Bitmap bitmap ) : System
scale float Logical pixel scale of the specified bitmap.
bitmap Bitmap Bitmap for the frame.
return System

Icon() public method

Intitializes a new instanc of the Icon class with the contents of the specified fileName
public Icon ( string fileName ) : System
fileName string Name of the file to loat the content from
return System