ComponentFactory.Krypton.Toolkit.ButtonValues.GetImage C# (CSharp) Method

GetImage() public method

Gets the content image.
public GetImage ( PaletteState state ) : Image
state PaletteState The state for which the image is needed.
return Image
        public virtual Image GetImage(PaletteState state)
        {
            Image image = null;

            // Try and find 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;
            }

            // If there is no image then use the generic image
            if (image == null)
                image = Image;

            return image;
        }

Usage Example

Esempio n. 1
0
 /// <summary>
 /// Gets the content image.
 /// </summary>
 /// <param name="state">The state for which the image is needed.</param>
 /// <returns>Image value.</returns>
 public Image GetImage(PaletteState state)
 {
     if (KryptonCommand != null)
     {
         return(KryptonCommand.ImageSmall);
     }
     else
     {
         return(_buttonValues.GetImage(state));
     }
 }