本文整理汇总了C#中IPalette.GetButtonSpecImage方法的典型用法代码示例。如果您正苦于以下问题:C# IPalette.GetButtonSpecImage方法的具体用法?C# IPalette.GetButtonSpecImage怎么用?C# IPalette.GetButtonSpecImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPalette
的用法示例。
在下文中一共展示了IPalette.GetButtonSpecImage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetImage
/// <summary>
/// Gets the button image.
/// </summary>
/// <param name="palette">Palette to use for inheriting values.</param>
/// <param name="state">State for which an image is needed.</param>
/// <returns>Button image.</returns>
public virtual Image GetImage(IPalette palette, PaletteState state)
{
Image image = null;
// Prefer to get image from the command first
if (KryptonCommand != null)
return KryptonCommand.ImageSmall;
// Try and recover a state specific image
switch (state)
{
case PaletteState.Disabled:
image = ImageStates.ImageDisabled;
break;
case PaletteState.Normal:
image = ImageStates.ImageNormal;
break;
case PaletteState.Pressed:
image = ImageStates.ImagePressed;
break;
case PaletteState.Tracking:
image = ImageStates.ImageTracking;
break;
case PaletteState.CheckedNormal:
image = ImageStates.ImageCheckedNormal;
break;
case PaletteState.CheckedPressed:
image = ImageStates.ImageCheckedPressed;
break;
case PaletteState.CheckedTracking:
image = ImageStates.ImageCheckedTracking;
break;
}
// Default to the image if no state specific image is found
if (image == null)
image = Image;
if ((image != null) || !AllowInheritImage)
return image;
else
return palette.GetButtonSpecImage(_type, state);
}