Export (0) Print
Expand All

ToolboxBitmapAttribute.GetImage Method (Type, String, Boolean)

Gets the small or large Image associated with this ToolboxBitmapAttribute object.

Namespace:  System.Drawing
Assembly:  System.Drawing (in System.Drawing.dll)

public Image GetImage(
	Type type,
	string imgName,
	bool large
)

Parameters

type
Type: System.Type

If this ToolboxBitmapAttribute object does not already have a small image, this method searches for an embedded bitmap resource in the assembly that defines the type specified by the component type. For example, if you pass typeof(ControlA) to the type parameter, then this method searches the assembly that defines ControlA.

imgName
Type: System.String

The name of the embedded bitmap resource.

large
Type: System.Boolean

Specifies whether this method returns a large image (true) or a small image (false). The small image is 16 by 16, and the large image is 32 by 32.

Return Value

Type: System.Drawing.Image
An Image associated with this ToolboxBitmapAttribute object.

This method searches for a resource named namespace.imgName, where namespace is the namespace containing the definition of the type specified by the type parameter. For example, suppose you pass typeof(ControlA) to the type parameter and that you passed "MyBitmap.bmp" to the imgName parameter. If ControlA is in NamespaceA in AssemblyA.dll, then this method searches AssemblyA.dll for a resource named NamespaceA.MyBitmap.bmp.

If this ToolboxBitmapAttribute object does not already have a large image, this method creates a large image by scaling the small image.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft