Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

16x16 icons showing as 1/4 of the 32x32 icons

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
mslosar
956 Views, 5 Replies

16x16 icons showing as 1/4 of the 32x32 icons

I'm guessing i'm doing something wrong, but for whatever reason, i've got two icons i'm trying to display as 16x16 in a panel of the ribbon. Initially, one icon had both 32x32 and 16x16 and the other just had a 32x32. When compiling the addin and running it, both icons are shown as 16x16, but they're 16x16 pie slices of the 32x32 icons. I even went back and added a 16x16 to the other icon resource.

 

I've only made a couple changes, but nothing seems to have any effect, they show just the top left 16x16 of the 32x32 icon. Is there something else you have to do other than spec FALSE where you add the button to the panel. (Sorry no code snips - i'm at home now without access). Do you have to somehow specify a specific version of the icon in the button definition where you spec the small and large icons?

 

I feel like i'm missing something.

 

Thanks

Mike

5 REPLIES 5
Message 2 of 6
mslosar
in reply to: mslosar

Probably should add this inv 2013 sp2 and i'm using the method as shown here:

 

http://modthemachine.typepad.com/my_weblog/2012/02/bitmaps-without-vb6-icontoipicture.html

Message 3 of 6
mslosar
in reply to: mslosar

I've come up with a workaround, but it seems to defeat the purpose of .ico files.

 

I made a copy of my icon that contained 16x16, 24x24, and 32x32 icons and removed all but the 16x16. I then added a new button variable pointing to the 16x16 only and then changed the button definition to point to the 'small only' version i created. This works. The only issue with that is then what is the point of an .ico file containing all sizes if I can't extract the right size at the .addbutton(buttonname, false) line?

 

I can't seem to come up with a phrasing in the buttondefintion that lets it point to 16x16 for standard and 32x32 for large icons.

Message 4 of 6
djreesing
in reply to: mslosar

How about: New System.Drawing.Icon(My.Resources.<your icon>, 16, 16)

Message 5 of 6
mslosar
in reply to: djreesing

Where does that fit into the method from the link above? Is it instead of or in addtion to:

 

Dim mIPictureDisp2 As IPictureDisp = _
            PictureDispConverter.ToIPictureDisp _
                                   (My.Resources.wbTest)

 

 

 

Message 6 of 6
djreesing
in reply to: mslosar

Replace My.Resources.wbTest by New System.Drawing.Icon(My.Resources.wbTest, 16, 16)

 

Dim mIPictureDisp2 As IPictureDisp = PictureDispConverter.ToIPictureDisp (New System.Drawing.Icon(My.Resources.wbTest, 16, 16))

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report