forked from ahyahy/OneScriptForms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImage.cs
More file actions
85 lines (67 loc) · 1.69 KB
/
Image.cs
File metadata and controls
85 lines (67 loc) · 1.69 KB
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
85
namespace osf
{
public class Image
{
public System.Drawing.Image M_Image;
public Image()
{
}
public Image(Stream stream)
{
M_Image = System.Drawing.Image.FromStream((System.IO.Stream)stream.M_Stream);
}
public Image(System.Drawing.Image p1)
{
M_Image = p1;
}
public Image(osf.Image p1)
{
M_Image = p1.M_Image;
}
//Свойства============================================================
public osf.ImageFormat RawFormat
{
get { return new ImageFormat(M_Image.RawFormat); }
}
public int Height
{
get { return M_Image.Height; }
}
public int PixelFormat
{
get { return (int)M_Image.PixelFormat; }
}
public osf.Size Size
{
get { return new Size(M_Image.Size); }
}
public int Width
{
get { return M_Image.Width; }
}
//Методы============================================================
public object Clone()
{
return M_Image.Clone();
}
public void Dispose()
{
M_Image.Dispose();
}
public void Save(Stream p1, ImageFormat p2)
{
M_Image.Save(p1.M_Stream, p2.M_ImageFormat);
}
public void Save(string p1, ImageFormat p2 = null)
{
if (p2 == null)
{
M_Image.Save(p1);
}
else
{
M_Image.Save(p1, p2.M_ImageFormat);
}
}
}
}