# ResourceProvider.GetSmallIcon Method

> Gets a System.Drawing.Bitmap of the small icon that is associated with an item and specified by an identifier or a Scalable Vector Graphics (SVG) stream parameter. The identifier can be the string conversion of an enumeration that is associated with an item (such as RibbonFormattingTab.RibbonItem.TXITEM_Paste). The size of the returned small icon depends on the resolution that is specified by the dpi parameter or the resolution of a specific control. The source of the small image is based on a grid of 16x16 Pixel and a resolution of 96 dpi.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 27.0
- **Namespace:** `TXTextControl.Windows.Forms`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXTextControl.Windows.Forms.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.Windows.Forms.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl.Windows.Forms > ResourceProvider.GetSmallIcon Method
- **2237 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms/resourceprovider/getsmallicon-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms/resourceprovider/getsmallicon-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms/resourceprovider/getsmallicon-method/llms-full.txt

---

### Description

Gets a System.Drawing.Bitmap of the [small icon](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms-ribbon/ribbonbutton/smallicon-property/llms-full.txt) that is associated with an item and specified by an identifier or a Scalable Vector Graphics (SVG) stream parameter. The identifier can be the string conversion of an enumeration that is associated with an item (such as [RibbonFormattingTab.RibbonItem.TXITEM\_Paste](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms-ribbon/ribbonformattingtab/ribbonitem-enumeration/llms-full.txt)). The size of the returned small icon depends on the resolution that is specified by the dpi parameter or the resolution of a specific control. The source of the small image is based on a grid of 16x16 Pixel and a resolution of 96 dpi.

### Syntax

#### GetSmallIcon(string, float)

Gets a System.Drawing.Bitmap of the small icon that is associated with the specified identifier in a specific resolution.

```csharp
public static Bitmap GetSmallIcon(string identifier, float dpi);
```

```vbnet
Public Shared Function GetSmallIcon(identifier As String, dpi As Single) As Bitmap
```

| Parameter | Description |
|---|---|
| identifier | The identifier of the item that is associated with the requested small icon. |
| dpi | Specifies the resolution that is used to create the requested small icon. |

#### GetSmallIcon(string, float, ResourceProvider.ImageSourceSettings)

Gets a System.Drawing.Bitmap of the small icon that is associated with the specified identifier in a specific resolution and additional image source settings.

```csharp
public static Bitmap GetSmallIcon(string identifier, float dpi, ResourceProvider.ImageSourceSettings settings);
```

```vbnet
Public Shared Function GetSmallIcon(identifier As String, dpi As Single, settings As ResourceProvider.ImageSourceSettings) As Bitmap
```

| Parameter | Description |
|---|---|
| identifier | The identifier of the item that is associated with the requested small icon. |
| dpi | Specifies the resolution that is used to create the requested small icon. |
| settings | Specifies an [ImageSourceSettings](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms/resourceprovider-imagesourcesettings/llms-full.txt) object with additional settings for receiving the small image. |

#### GetSmallIcon(Stream, float)

Gets a small System.Drawing.Bitmap icon that is created from a Scalable Vector Graphics (SVG) stream in a specific resolution .

```csharp
public static Bitmap GetSmallIcon(Stream stream, float dpi);
```

```vbnet
Public Shared Function GetSmallIcon(stream As Stream, dpi As Single) As Bitmap
```

| Parameter | Description |
|---|---|
| stream | Specifies the Scalable Vector Graphics (SVG) stream that is used to create the requested small icon. |
| dpi | Specifies the resolution that is used to create the requested small icon. |

#### GetSmallIcon(string, Control)

Gets a System.Drawing.Bitmap of the small icon that is associated with the specified identifier in the resolution of a specific control.

```csharp
public static Bitmap GetSmallIcon(string identifier, Control control);
```

```vbnet
Public Shared Function GetSmallIcon(identifier As String, control As Control) As Bitmap
```

| Parameter | Description |
|---|---|
| identifier | The identifier of the item that is associated with the requested small icon. |
| control | Specifies the control from where the resolution is determined that is used to create the requested small icon. |

#### GetSmallIcon(string, Control, ResourceProvider.ImageSourceSettings)

Gets a System.Drawing.Bitmap of the small icon that is associated with the specified identifier in the resolution of a specific control and additional image source settings.

```csharp
public static Bitmap GetSmallIcon(string identifier, Control control, ResourceProvider.ImageSourceSettings settings);
```

```vbnet
Public Shared Function GetSmallIcon(identifier As String, control As Control, settings As ResourceProvider.ImageSourceSettings) As Bitmap
```

| Parameter | Description |
|---|---|
| identifier | The identifier of the item that is associated with the requested small icon. |
| control | Specifies the control from where the resolution is determined that is used to create the requested small icon. |
| settings | Specifies an [ImageSourceSettings](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms/resourceprovider-imagesourcesettings/llms-full.txt) object with additional settings for receiving the small image. |

#### GetSmallIcon(Stream, Control)

Gets a small System.Drawing.Bitmap icon that is created from a Scalable Vector Graphics (SVG) stream in the resolution of the specified control.

```csharp
public static Bitmap GetSmallIcon(Stream stream, Control control);
```

```vbnet
Public Shared Function GetSmallIcon(stream As Stream, control As Control) As Bitmap
```

| Parameter | Description |
|---|---|
| stream | Specifies the Scalable Vector Graphics (SVG) stream that is used to create the requested small icon. |
| control | Specifies the control from where the resolution is determined that is used to create the requested small icon. |

### Return Value

A bitmap of the small icon that is assigned to the item. If no small icon is associated with the item, the method returns null.

### Examples

The following example retrieves small icon from the resource provider.

```csharp
var result = TXTextControl.Windows.Forms.ResourceProvider.GetSmallIcon("Quarterly report", new System.Windows.Forms.Control());
Console.WriteLine($"Get Small Icon result: {result}");
```

```vbnet
Dim result = TXTextControl.Windows.Forms.ResourceProvider.GetSmallIcon("Quarterly report", New System.Windows.Forms.Control())
Console.WriteLine($"Get Small Icon result: {result}")
```

### Remarks

An exception is thrown if the handle of the specified `control` parameter is not created.

---

## Nearby

- **Previous:** [ResourceProvider.GetLargeIcon Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms/resourceprovider/getlargeicon-method/llms-full.txt)
- **Next:** [ResourceProvider.GetText Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms/resourceprovider/gettext-method/llms-full.txt)
