-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainForm.cs
45 lines (39 loc) · 1.38 KB
/
MainForm.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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TotallyNotMalware
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
System.Net.WebRequest request = System.Net.WebRequest.Create(
"https://bocchi.rocks/assets/img/page/character/ryo/main.png"
);
System.Net.WebResponse response = request.GetResponse();
System.IO.Stream responseStream = response.GetResponseStream();
Bitmap ryo = new Bitmap(responseStream);
Bitmap resizedRyo = new Bitmap(lordAndSavior.Width, lordAndSavior.Height);
Graphics g = Graphics.FromImage(resizedRyo);
Rectangle srcRect = new Rectangle(29, 16, 260, 316);
Rectangle destRect = new Rectangle(0, 0, lordAndSavior.Width, lordAndSavior.Height);
g.DrawImage(ryo, destRect, srcRect, GraphicsUnit.Pixel);
g.Dispose();
lordAndSavior.Image = resizedRyo;
}
private void btnSubmit_Click(object sender, EventArgs e)
{
Hide();
ThanksForm f = new ThanksForm();
f.ShowDialog();
Close();
}
}
}