Demo增加FTransfer穿梭框控件显示

This commit is contained in:
Sunny 2020-05-20 23:07:22 +08:00
parent e0a6a6ff2f
commit 25d3ef84a7
6 changed files with 6 additions and 4 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -24,6 +24,7 @@ namespace Sunny.UI.Demo
Aside.CreateChildNode(parent, AddPage(new FTabControl(), ++pageIndex));
Aside.CreateChildNode(parent, AddPage(new FLine(), ++pageIndex));
Aside.CreateChildNode(parent, AddPage(new FPanel(), ++pageIndex));
Aside.CreateChildNode(parent, AddPage(new FTransfer(), ++pageIndex));
Aside.CreateChildNode(parent, AddPage(new FAvatar(), ++pageIndex));
Aside.CreateChildNode(parent, AddPage(new FContextMenuStrip(), ++pageIndex));
Aside.CreateChildNode(parent, AddPage(new FMeter(), ++pageIndex));

View File

@ -156,10 +156,11 @@ namespace Sunny.UI
public static Image CreateImage(int symbol, int size, Color color)
{
Bitmap image = new Bitmap(size, size);
Graphics g = image.Graphics();
SizeF ImageSize = g.GetFontImageSize(symbol, size);
Font font = GetFont(symbol, size);
g.DrawString(char.ConvertFromUtf32(symbol), font, color, (size - ImageSize.Width) / 2.0f, (size - ImageSize.Height) / 2.0f);
using (Graphics g = image.Graphics())
{
g.DrawFontImage(symbol, size, color, image.Bounds());
}
return image;
}