GetSmallIcon Method
- Namespace
TXTextControl.WPF
- Package
TXTextControl.asTextControl. WPF. SDK TXTextControl.from the private NuGet feed or Text Control Offline PackagesWPF. dll
Description
Gets a System.Windows.Media.Imaging.BitmapSource of the small icon that is associated with an item and specified by an identifier or 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 a specific framework element. The source of the small image is based on a grid of 16x16 Pixel and a resolution of 96 dpi.
Syntax
GetSmallIcon(string, double)
Gets a System.Windows.Media.Imaging.BitmapSource of the small icon that is associated with the specified identifier in a specific resolution.
public static BitmapSource GetSmallIcon(string identifier, double dpi);Public Shared Function GetSmallIcon(identifier As String, dpi As Double) As BitmapSource| 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, double, ResourceProvider.ImageSourceSettings)
Gets a System.Windows.Media.Imaging.BitmapSource of the small icon that is associated with the specified identifier in a specific resolution and additional image source settings.
public static BitmapSource GetSmallIcon(string identifier, double dpi, ResourceProvider.ImageSourceSettings settings);Public Shared Function GetSmallIcon(identifier As String, dpi As Double, settings As ResourceProvider.ImageSourceSettings) As BitmapSource| 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 object with additional settings for receiving the small image. |
GetSmallIcon(Stream, float)
Gets a small System.Windows.Media.Imaging.BitmapSource icon that is created from a Scalable Vector Graphics (SVG) stream in a specific resolution.
public static BitmapSource GetSmallIcon(Stream stream, float dpi);Public Shared Function GetSmallIcon(stream As Stream, dpi As Single) As BitmapSource| 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, FrameworkElement)
Gets a System.Windows.Media.Imaging.BitmapSource of the small icon that is associated with the specified identifier in the resolution of a specific framework element.
public static BitmapSource GetSmallIcon(string identifier, FrameworkElement frameworkElement);Public Shared Function GetSmallIcon(identifier As String, frameworkElement As FrameworkElement) As BitmapSource| Parameter | Description |
|---|---|
| identifier | The identifier of the item that is associated with the requested small icon. |
| frameworkElement | Specifies the framework element from where the resolution is determined that is used to create the requested small icon. |
GetSmallIcon(string, FrameworkElement, ResourceProvider.ImageSourceSettings)
Gets a System.Windows.Media.Imaging.BitmapSource of the small icon that is associated with the specified identifier in the resolution of a specific framework element and additional image source settings.
public static BitmapSource GetSmallIcon(string identifier, FrameworkElement frameworkElement, ResourceProvider.ImageSourceSettings settings);Public Shared Function GetSmallIcon(identifier As String, frameworkElement As FrameworkElement, settings As ResourceProvider.ImageSourceSettings) As BitmapSource| Parameter | Description |
|---|---|
| identifier | The identifier of the item that is associated with the requested small icon. |
| frameworkElement | Specifies the framework element from where the resolution is determined that is used to create the requested small icon. |
| settings | Specifies an ImageSourceSettings object with additional settings for receiving the small image. |
GetSmallIcon(Stream, FrameworkElement)
Gets a small System.Windows.Media.Imaging.BitmapSource icon that is created from a Scalable Vector Graphics (SVG) stream in the resolution of the specified framework element.
public static BitmapSource GetSmallIcon(Stream stream, FrameworkElement frameworkElement);Public Shared Function GetSmallIcon(stream As Stream, frameworkElement As FrameworkElement) As BitmapSource| Parameter | Description |
|---|---|
| stream | Specifies the Scalable Vector Graphics (SVG) stream that is used to create the requested small icon. |
| frameworkElement | Specifies the framework element 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.
var result = TXTextControl.WPF.ResourceProvider.GetSmallIcon("Quarterly report", new System.Windows.FrameworkElement());
Console.WriteLine($"Get Small Icon result: {result}");Dim result = TXTextControl.WPF.ResourceProvider.GetSmallIcon("Quarterly report", New System.Windows.FrameworkElement())
Console.WriteLine($"Get Small Icon result: {result}")Remarks
An exception is thrown if the instance of the specified frameworkElement parameter is not loaded.