-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyForm.cs
42 lines (32 loc) · 1.18 KB
/
MyForm.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
// Form継承 2017/11/25 T.Umezawa
using System;
using System.Collections.Generic;
class MyForm : System.Windows.Forms.Form
{
protected System.Timers.Timer mTimer = new System.Timers.Timer();
protected System.Drawing.SolidBrush mSBWhite = new System.Drawing.SolidBrush( System.Drawing.Color.White );
protected override void OnLoad( EventArgs e )
{
ClientSize = new System.Drawing.Size( 960, 720 );
Left = 396; // キャプチャ都合上
Top = 20; // キャプチャ都合上
DoubleBuffered = true;
BackColor = System.Drawing.Color.FromArgb( 0x55, 0x88, 0xff );
mTimer.Elapsed += new System.Timers.ElapsedEventHandler( onMyTimer );
}
protected override void OnPaint( System.Windows.Forms.PaintEventArgs e )
{
base.OnPaint( e );
System.Drawing.Graphics g = e.Graphics;
g.ScaleTransform( 4, 4 );
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Half;
onMyPaint( g );
}
protected virtual void onMyPaint( System.Drawing.Graphics g )
{
}
protected virtual void onMyTimer( object sender, System.Timers.ElapsedEventArgs e )
{
}
}