-
Notifications
You must be signed in to change notification settings - Fork 1
/
frmSplash.cs
69 lines (56 loc) · 2.44 KB
/
frmSplash.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace SC2Scrapbook
{
public partial class frmSplash : Form
{
public static frmSplash Instance { get; private set; }
public frmSplash()
{
Instance = this;
InitializeComponent();
}
public static void ShowSplash()
{
if (Instance != null)
CloseSplash();
System.Threading.Thread thread = new System.Threading.Thread(new System.Threading.ThreadStart(delegate() {
Application.Run(new frmSplash());
}));
thread.Start();
}
public static void CloseSplash()
{
if (Instance == null)
return;
Instance.Invoke(new Action(delegate() {
Instance.Close();
Instance.Dispose();
}));
Instance.Dispose();
Instance = null;
}
private void frmSplash_Load(object sender, EventArgs e)
{
System.Version version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
lblVersion.Text = string.Format(lblVersion.Text, version.Major, version.Minor);
Image image = new Bitmap(420, 45);
Graphics g = Graphics.FromImage(image);
g.DrawImage(Properties.Resources.bronze, new Rectangle(0, 0, 45, 45), 100, 150, 45, 45, GraphicsUnit.Pixel);
g.DrawImage(Properties.Resources.silver, new Rectangle(60, 0, 45, 45), 100, 150, 45, 45, GraphicsUnit.Pixel);
g.DrawImage(Properties.Resources.gold, new Rectangle(120, 0, 45, 45), 100, 150, 45, 45, GraphicsUnit.Pixel);
g.DrawImage(Properties.Resources.platinum, new Rectangle(180, 0, 45, 45), 100, 150, 45, 45, GraphicsUnit.Pixel);
g.DrawImage(Properties.Resources.diamond, new Rectangle(240, 0, 45, 45), 100, 150, 45, 45, GraphicsUnit.Pixel);
g.DrawImage(Properties.Resources.master, new Rectangle(300, 0, 45, 45), 100, 150, 45, 45, GraphicsUnit.Pixel);
g.DrawImage(Properties.Resources.grandmaster, new Rectangle(360, 0, 45, 45), 100, 150, 45, 45, GraphicsUnit.Pixel);
g.Dispose();
pnlLeagues.BackgroundImage = image;
}
}
}