-
Notifications
You must be signed in to change notification settings - Fork 0
/
FormAbout.cs
64 lines (58 loc) · 1.85 KB
/
FormAbout.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
using System.Drawing.Drawing2D;
using System.Net.NetworkInformation;
namespace chusongtool
{
public partial class FormAbout : Form
{
public FormAbout()
{
InitializeComponent();
}
private void FormAbout_Load(object sender, EventArgs e)
{
if (NetworkInterface.GetIsNetworkAvailable())
{
pictureBox1.ImageLocation = "https://avatars.githubusercontent.com/u/59692068?v=4";
}
else
{
pictureBox1.Image = res.Resource.f089e80b819fe6da7d36bea8bf647d04_t;
}
}
private void LinkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Common.Utils.OpenURI("https://github.com/XyLe-GBP");
return;
}
private void LinkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Common.Utils.OpenURI("https://xyle-official.com");
return;
}
private void ButtonOK_Click(object sender, EventArgs e)
{
Close();
return;
}
private void PictureBox1_Paint(object sender, PaintEventArgs e)
{
try
{
base.OnPaint(e);
Bitmap canvas = new Bitmap(pictureBox1.Width, pictureBox1.Height);
Graphics g = Graphics.FromImage(canvas);
GraphicsPath gp = new();
gp.AddEllipse(g.VisibleClipBounds);
Region rgn = new(gp);
pictureBox1.Region = rgn;
return;
}
catch (Exception ex)
{
MessageBox.Show("An error has occurred: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
Close();
return;
}
}
}
}