DotNet 4.8.1 build of DotNetBar

This commit is contained in:
2025-02-07 10:35:23 -05:00
parent 33439b63a0
commit 6b0a5d60f4
2609 changed files with 989814 additions and 7 deletions

View File

@@ -0,0 +1,54 @@
using System.Drawing;
namespace DevComponents.DotNetBar.SuperGrid
{
///<summary>
/// CheckDisplay
///</summary>
static public class ExpandDisplay
{
#region RenderButton
///<summary>
/// RenderButton
///</summary>
///<param name="g"></param>
///<param name="image"></param>
///<param name="buttonBounds"></param>
///<param name="clipBounds"></param>
static public Size RenderButton(Graphics g,
Image image, Rectangle buttonBounds, Rectangle clipBounds)
{
if (image != null && buttonBounds.IsEmpty == false)
{
Rectangle r = buttonBounds;
r.Width++;
r.Height++;
Size isize = Dpi.Size(image.Size);
if (r.Width > isize.Width)
{
r.X += (r.Width - isize.Width) / 2;
r.Width = isize.Width;
}
if (r.Height > isize.Height)
{
r.Y += (r.Height - isize.Height) / 2;
r.Height = isize.Height;
}
r.Intersect(clipBounds);
g.DrawImageUnscaledAndClipped(image, r);
return (r.Size);
}
return (Size.Empty);
}
#endregion
}
}