public Pixbuf GetPixbuf(int parentWidth, int parentHeight) { Pixbuf p = ForcePixbuf; if (p == null) { p = DockServices.Drawing.LoadIcon(Icon, IconSize); } // constrain the icon to PercentOfParent if needed, if (p.Width > (int)(parentWidth * PercentOfParent) || p.Height > (int)(parentHeight * PercentOfParent)) { p = p.ARScale((int)(parentWidth * PercentOfParent), (int)(parentHeight * PercentOfParent)); } return(p); }