Every time I created a ribbon button, I was faced with the task of creating appropriately scaled icons for it to populate the
PushButton large and small image icon properties
They seem to expect a 32 x 32 and 16 x 16 icon, respectively.
I finally solved that once and for all by implementing a couple of methods to perform automatic bitmap scaling
– BitmapImageToBitmap – convert a
– BitmapToBitmapSource – convert a
Bitmap to a
– ResizeImage – resize an image to the specified width and height
– ScaledIcon – scale down large icon to desired size for Revit ribbon button
– Usage sample – putting them together...