Eto.Drawing.Bitmap.FromResource C# (CSharp) Method

FromResource() public static method

Loads a bitmap from a resource in the same assembly as the specified type
public static FromResource ( string resourceName, Type type ) : Bitmap
resourceName string Full name of the resource in the type's assembly.
type System.Type Type of the assembly to get the resource.
return Bitmap
		public static Bitmap FromResource(string resourceName, Type type)
		{
			if (type == null)
				throw new ArgumentNullException("type");
			return FromResource(resourceName, type.GetAssembly());
		}

Same methods

Bitmap::FromResource ( string resourceName, Assembly assembly = null ) : Bitmap

Usage Example

Example #1
0
        Image LoadImage(NamespaceInfo ns)
        {
            var isIcon = IsIcon(ns.Namespace);

            if (isIcon)
            {
                return(Icon.FromResource(ns.Namespace, ns.Assembly));
            }
            return(Bitmap.FromResource(ns.Namespace, ns.Assembly));
        }