[]
        
(Showing Draft Content)

C1.Win.Ribbon.C1Ribbon.GetPresetImage

GetPresetImage Method

GetPresetImage(string, int)

Returns a bitmap image from build-in C1Ribbon presets for the current theme lightness.

Declaration
public Image GetPresetImage(string key, int size)
Parameters
Type Name Description
string key

The icon key.

int size

The icon size

Returns
Type Description
Image

The bitmap image from build-in C1Ribbon preset. If image with specified key is not found, returns null. If image with specified size is not found, returns the most appropriate image resized to the specified size.

Remarks

You have item with a icon from build-in preset: ribbonButton1.IconSet.Add(new C1.Framework.C1BitmapIcon("Book", new System.Drawing.Size(32, 32), System.Drawing.Color.Transparent, "Preset_LargeImages", 22)); You can get this image: var bookImage = c1ribbon.GetPressetImage(ribbonButton1.IconSet[1].Key, 32); The C1Ribbon contains 16px, 20px and 32px build-in presets.

GetPresetImage(string, int, bool)

Returns a bitmap image from build-in C1Ribbon presets.

Declaration
public Image GetPresetImage(string key, int size, bool isDarkTheme)
Parameters
Type Name Description
string key

The icon key.

int size

The icon size

bool isDarkTheme

Determines whether the icons are dark or not.

Returns
Type Description
Image

The bitmap image from build-in C1Ribbon preset. If image with specified key is not found, returns null. If image with specified size is not found, returns the most appropriate image resized to the specified size.

Remarks

You have item with a icon from build-in preset: ribbonButton1.IconSet.Add(new C1.Framework.C1BitmapIcon("Book", new System.Drawing.Size(32, 32), System.Drawing.Color.Transparent, "Preset_LargeImages", 22)); You can get this image: var bookImage = c1ribbon.GetPressetImage(ribbonButton1.IconSet[1].Key, 32); The C1Ribbon contains 16px, 20px and 32px build-in presets.