TX Text Control .NET for Windows Forms

GetLargeIcon Method

Method|Introduced in 27.0
Namespace
TXTextControl.Windows.Forms
Package
TXTextControl.TextControl.WinForms.SDK as TXTextControl.Windows.Forms.dll from the private NuGet feed or Text Control Offline Packages

Description

Gets a System.Drawing.Bitmap of the large 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 large icon depends on the resolution that is specified by the dpi parameter or the resolution of a specific control. The source of the large image should be based on a grid of 32x32 Pixel and a resolution of 96 dpi.

Syntax

GetLargeIcon(string, float)

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

public static Bitmap GetLargeIcon(string identifier, float dpi);
ParameterDescription
identifier

The identifier of the item that is associated with the requested large icon.

dpi

Specifies the resolution that is used to create the requested large icon.

GetLargeIcon(string, float, ResourceProvider.ImageSourceSettings)

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

public static Bitmap GetLargeIcon(string identifier, float dpi, ResourceProvider.ImageSourceSettings settings);
ParameterDescription
identifier

The identifier of the item that is associated with the requested large icon.

dpi

Specifies the resolution that is used to create the requested large icon.

settings

Specifies an ImageSourceSettings object with additional settings for receiving the large image.

GetLargeIcon(Stream, float)

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

public static Bitmap GetLargeIcon(Stream stream, float dpi);
ParameterDescription
stream

Specifies the Scalable Vector Graphics (SVG) stream that is used to create the requested large icon.

dpi

Specifies the resolution that is used to create the requested large icon.

GetLargeIcon(string, Control)

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

public static Bitmap GetLargeIcon(string identifier, Control control);
ParameterDescription
identifier

The identifier of the item that is associated with the requested large icon.

control

Specifies the control from where the resolution is determined that is used to create the requested large icon.

GetLargeIcon(string, Control, ResourceProvider.ImageSourceSettings)

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

public static Bitmap GetLargeIcon(string identifier, Control control, ResourceProvider.ImageSourceSettings settings);
ParameterDescription
identifier

The identifier of the item that is associated with the requested large icon.

control

Specifies the control from where the resolution is determined that is used to create the requested large icon.

settings

Specifies an ImageSourceSettings object with additional settings for receiving the large image.

GetLargeIcon(Stream, Control)

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

public static Bitmap GetLargeIcon(Stream stream, Control control);
ParameterDescription
stream

Specifies the Scalable Vector Graphics (SVG) stream that is used to create the requested large icon.

control

Specifies the control from where the resolution is determined that is used to create the requested large icon.

Return Value

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

Examples

The following example retrieves large icon from the resource provider.

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

Remarks

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