Beispiel #1
0
 public IPictureDisp HighlightButton_GetImage(IRibbonControl control)
 {
     using (var image = Resources.Img.highlighter_color)
         using (var graphics = Graphics.FromImage(image))
             using (var colorBrush = new SolidBrush(currentColor))
             {
                 graphics.FillRectangle(colorBrush, 0, 28, 32, 4);
                 return(PictureConverter.ImageToPictureDisp(image));
             }
 }
Beispiel #2
0
 public IPictureDisp ColorGallery_GetItemImage(IRibbonControl control, int index)
 {
     using (var image = new Bitmap(galleryItemSize, galleryItemSize))
         using (var graphics = Graphics.FromImage(image))
             using (var borderBrush = new SolidBrush(borderColor))
                 using (var colorBrush = new SolidBrush(GetGalleryColor(index)))
                 {
                     graphics.FillRectangle(borderBrush, 0, 0, galleryItemSize, galleryItemSize);
                     graphics.FillRectangle(colorBrush, 1, 1, galleryItemSize - 2, galleryItemSize - 2);
                     return(PictureConverter.ImageToPictureDisp(image));
                 }
 }
Beispiel #3
0
        public IPictureDisp GetImage(IRibbonControl control)
        {
            Bitmap image = null;

            switch (control.Id)
            {
            case "ColorGallery":
                image = Resources.Img.color_swatch;
                break;

            case "MoreColorButton":
                image = Resources.Img.color;
                break;

            case "ClearButton":
                image = Resources.Img.eraser;
                break;

            default:
                return(null);
            }

            return(PictureConverter.ImageToPictureDisp(image));
        }