1 | using System; |
---|
2 | using System.Collections.Generic; |
---|
3 | using System.ComponentModel; |
---|
4 | using System.Data; |
---|
5 | using System.Drawing; |
---|
6 | using System.Drawing.Text; |
---|
7 | using System.Linq; |
---|
8 | using System.Runtime.InteropServices; |
---|
9 | using System.Text; |
---|
10 | using System.Threading.Tasks; |
---|
11 | using System.Windows.Forms; |
---|
12 | |
---|
13 | namespace Cmd |
---|
14 | { |
---|
15 | public partial class Form1 : Form |
---|
16 | { |
---|
17 | public Form1() |
---|
18 | { |
---|
19 | InitializeComponent(); |
---|
20 | timer1.Start(); |
---|
21 | |
---|
22 | PrivateFontCollection pfc = new PrivateFontCollection(); |
---|
23 | |
---|
24 | ////Select your font from the resources. |
---|
25 | ////My font here is "Digireu.ttf" |
---|
26 | //int fontLength = VTSDeviceCalibrationUtility.Properties.Resources.Digireu.Length; |
---|
27 | |
---|
28 | //// create a buffer to read in to |
---|
29 | //byte[] fontdata = VTSDeviceCalibrationUtility.Properties.Resources.Digireu; |
---|
30 | |
---|
31 | //// create an unsafe memory block for the font data |
---|
32 | //System.IntPtr data = Marshal.AllocCoTaskMem(fontLength); |
---|
33 | |
---|
34 | //// copy the bytes to the unsafe memory block |
---|
35 | //Marshal.Copy(fontdata, 0, data, fontLength); |
---|
36 | |
---|
37 | // pass the font to the font collection |
---|
38 | //pfc.AddMemoryFont(data, fontLength); |
---|
39 | |
---|
40 | pfc.AddFontFile("TerminalVector.ttf"); |
---|
41 | |
---|
42 | label1.Font = new Font(pfc.Families[0], label1.Font.Size); |
---|
43 | |
---|
44 | label2.Font = new Font(pfc.Families[0], label2.Font.Size); |
---|
45 | |
---|
46 | //// free up the unsafe memory |
---|
47 | //Marshal.FreeCoTaskMem(data); |
---|
48 | } |
---|
49 | |
---|
50 | private void label2_Click(object sender, EventArgs e) |
---|
51 | { |
---|
52 | |
---|
53 | } |
---|
54 | int LabelJuttu = 0; |
---|
55 | private void timer1_Tick(object sender, EventArgs e) |
---|
56 | { |
---|
57 | if (LabelJuttu == 0) |
---|
58 | { |
---|
59 | label2.Visible = false; |
---|
60 | LabelJuttu++; |
---|
61 | } |
---|
62 | else |
---|
63 | { |
---|
64 | label2.Visible = true; |
---|
65 | LabelJuttu--; |
---|
66 | } |
---|
67 | } |
---|
68 | } |
---|
69 | } |
---|