Modify the Master Icon at run time?

Started by michelleh, June 02, 2009, 05:44:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

michelleh

I'm working on a c# addon where the user wants a small flag inserted into a master's icon based on a shape data value.  The look they want is similar to the little arrow at the lower right corner of a Windows icon to show that it is a shortcut.

I have the code in place to watch for changes to the shape data value, so all I need to do is actually change the icon.  Has anyone done this kind of thing and can point me in the right direction?

Thanks!

Wombat

I think masters have import and export methods. You could probably make an icon out of the original and the shortcut arrow, then import it. Not sure how the transparency works--it's kind of weird in the icon editor.
6'4" and full of muscle

michelleh

The key is that I need to be able to do this with any master, so I can't pre-create the icon and use import, unfortunately.

I did finally get this to work by taking the IPictureDisp that Master.Icon returns, converting it to a .Net System.Drawing object, merging the icons using System.Drawing methods, converting it back to an IPictureDisp and setting Master.Icon.  It would have been nice if Master.Icon returned a .Net-based type, but at least it's doable.

-- Michelle