If what you want to know is how to change the icon, then the code is something like this :
schematikDifferenceButton.ButtonDefinition.LargeIcon = AxHostConverter.ImageToPictureDisp(Icons.BigSchematikDifferenceIcon(isDarkMode: true));
schematikDifferenceButton.ButtonDefinition.StandardIcon = AxHostConverter.ImageToPictureDisp(Icons.SmallSchematikDifferenceIcon(isDarkMode: true));
where AxHostConverter is based on System.Windows.Forms.AxHost and uses stdole (which you need to set the reference to the dll manually)
internal class AxHostConverter : AxHost
{
private AxHostConverter() : base("") { }
static public stdole.IPictureDisp ImageToPictureDisp(Image image)
{
return (stdole.IPictureDisp)GetIPictureDispFromPicture(image);
}
static public Image PictureDispToImage(stdole.IPictureDisp pictureDisp)
{
return GetPictureFromIPicture(pictureDisp);
}
}
If what you want to know is how to create an Icon for Inventor, there are many options, but you need to have something that is derived from System.Drawing.Image to convert to IPictureDisp. In my case, I work with System.Drawing.Bitmap. Small Icons are 16x16px and Big Icons are 32x32px