public ImageElement(Graphics gr, Point poscentrehorz, string text, Font dp, Color c, Object t = null, string tt = null) { img = ControlHelpers.DrawTextIntoAutoSizedBitmap(text, dp, c); pos = new Rectangle(poscentrehorz.X - img.Width / 2, poscentrehorz.Y, img.Width, img.Height); tag = t; tooltip = tt; }
// top left, autosized public void TextAutosize(Point topleft, Size max, string text, Font dp, Color c, Color backcolour, float backscale = 1.0F, Object t = null, string tt = null) { img = ControlHelpers.DrawTextIntoAutoSizedBitmap(text, max, dp, c, backcolour, backscale); pos = new Rectangle(topleft.X, topleft.Y, img.Width, img.Height); tag = t; tooltip = tt; }