-
Notifications
You must be signed in to change notification settings - Fork 0
/
Frame.cs
84 lines (72 loc) · 1.65 KB
/
Frame.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
using System;
using System.IO;
using System.Drawing;
namespace XMPNG
{
[Serializable] public class Frame : IDisposable
{
MemoryStream ms;
int seq, mouseX=0, mouseY=0;
private bool disposed = false;
public Frame(Bitmap bm, int seq)
{
this.ms = new MemoryStream();
bm.Save(this.ms, System.Drawing.Imaging.ImageFormat.Png);
this.seq = seq; // sequence number
}
public void setMouseCoords(int x, int y)
{
this.mouseX = x;
this.mouseY = y;
}
public Bitmap Bitmap
{
get
{
Bitmap bm = new Bitmap(this.ms);
return bm;
}
}
public int Seq
{
get
{
return this.seq;
}
set
{
this.seq = value;
}
}
public int MouseX
{
get
{
return this.mouseX;
}
}
public int MouseY
{
get
{
return this.mouseY;
}
}
private void Dispose(bool disposing)
{
if(!this.disposed)
{
if(disposing)
{
this.ms.Dispose();
}
}
disposed = true;
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
}
}