* UIForm:增加标题栏ICON图标绘制

This commit is contained in:
Sunny 2020-07-10 22:25:21 +08:00
parent 25bbcd2e62
commit 203e9f0a41
7 changed files with 742 additions and 659 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 43 KiB

View File

@ -896,6 +896,11 @@ namespace Sunny.UI
e.Graphics.SetDefaultQuality();
if (Icon != null)
{
e.Graphics.DrawImage(Icon.ToBitmap(), 6, (TitleHeight - 24) / 2, 24, 24);
}
SizeF sf = e.Graphics.MeasureString(Text, Font);
if (TextAlignment == StringAlignment.Center)
{
@ -903,7 +908,7 @@ namespace Sunny.UI
}
else
{
e.Graphics.DrawString(Text, Font, titleForeColor, 6, (TitleHeight - sf.Height) / 2);
e.Graphics.DrawString(Text, Font, titleForeColor,6 + (Icon == null ? 0 : 26), (TitleHeight - sf.Height) / 2);
}
}