Closed GoogleCodeExporter closed 8 years ago
The whole ImageConverter and IPictureDisp story can be removed from Ribbon.cs,
and replaced by just:
public Bitmap Logo(IRibbonControl control)
{
return FinAnSu.Properties.Resources.logo_abbrev;
}
The getImage handler in the ribbon .xml can return:
1. An IPictureDisp, or
2. A System.Drawing.Bitmap, or
3. A string containing an imageMso identifier.
The .NET Bitmap class has a member called GetHBitmap() that is called via the
Dispatch interface. This is enough to support the ribbon image callback.
More info here:
http://blogs.msdn.com/b/jensenh/archive/2006/11/27/ribbonx-image-faq.aspx.
Original comment by gov...@icon.co.za
on 24 May 2011 at 7:20
Thanks, Govert. Honestly, I'm not sure why I didn't just do that in the first
place, aside from a set-it-and-forget-it attitude toward Ribbon.cs. Anyway, I
wound up using something like your code with a minor change to make it easier
if I want to add different icons in the future.
public Bitmap GetImage(IRibbonControl control)
{
return (Bitmap)FinAnSu.Properties.Resources.ResourceManager.GetObject(control.Tag);
}
If it fails to find whatever's specified in the Ribbon control's tag attribute
the user just sees a blank image.
The other issue should also be resolved.
Original comment by Bryan.McKelvey
on 25 May 2011 at 3:31
Original comment by Bryan.McKelvey
on 25 May 2011 at 3:32
Original issue reported on code.google.com by
paulbees...@googlemail.com
on 22 May 2011 at 9:51