- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 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
if (command == "help") ShowHelp();
else if (command == "") Error(1);
else
{
string[] pcmd = command.Split(' ');
string[] args = { "0,0", "0,0" };
string argv = "Black";
if (pcmd[0] != "setColor" &&
pcmd[0] != "save" &&
pcmd[0] != "fill" &&
pcmd[0] != "saveCMD" &&
pcmd[0] != "close" &&
pcmd[0] != "if" &&
pcmd[0] != "from" &&
pcmd[0] != "setVar" &&
pcmd[0] != "getVar" &&
pcmd[0] != "setRGB" &&
pcmd[0] != "fillFRGB" &&
pcmd[0] != "fillRGB" &&
pcmd[0] != "setPenSize" &&
pcmd[0] != "fillF" &&
pcmd[1] != "#?") args = pcmd[1].Split('|');
else if (pcmd[0] == "setVar") argv = pcmd[1] + " " + pcmd[3];
else if (pcmd[1] == "#?")
{
Help4command(pcmd[0]);
return;
}
else argv = pcmd[1];
switch (pcmd[0])
{
case "save":
try { bmp.Save(argv + "\\" + Name + ".png",ImageFormat.Png); }
catch { Error(2); }
break;
case "line":
{
string[] xy0 = args[0].Split(',');
string[] xy1 = args[1].Split(',');
int x0 = 0, y0 = 0, x1 = 0, y1 = 0;
if (xy0[0] == "w" || xy0[0] == "W") x0 = W;
if (xy0[1] == "h" || xy0[1] == "H") y0 = H;
if (xy1[0] == "w" || xy1[0] == "W") x1 = W;
if (xy1[1] == "h" || xy1[1] == "H") y1 = H;
if (VL.isExistVar(xy0[0])) x0 = int.Parse(VL.Get(xy0[0]));
if (VL.isExistVar(xy0[1])) y0 = int.Parse(VL.Get(xy0[1]));
if (VL.isExistVar(xy1[0])) x1 = int.Parse(VL.Get(xy1[0]));
if (VL.isExistVar(xy1[1])) y1 = int.Parse(VL.Get(xy1[1]));
try
{
x0 = int.Parse(xy0[0]);
y0 = int.Parse(xy0[1]);
x1 = int.Parse(xy1[0]);
y1 = int.Parse(xy1[1]);
}
finally { }
graph.DrawLine(new Pen(usesCol, penSize), new Point(x0, y0), new Point(x1, y1));
}
break;
case "rect":
{
if (fiilF == false)
{
string[] xy0 = args[0].Split(',');
string[] xy1 = args[1].Split(',');
int x0 = 0, y0 = 0, x1 = 0, y1 = 0;
if (xy0[0] == "w" || xy0[0] == "W") x0 = W;
if (xy0[1] == "h" || xy0[1] == "H") y0 = H;
if (xy1[0] == "w" || xy1[0] == "W") x1 = W;
if (xy1[1] == "h" || xy1[1] == "H") y1 = H;
if (VL.isExistVar(xy0[0])) x0 = int.Parse(VL.Get(xy0[0]));
if (VL.isExistVar(xy0[1])) y0 = int.Parse(VL.Get(xy0[1]));
if (VL.isExistVar(xy1[0])) x1 = int.Parse(VL.Get(xy1[0]));
if (VL.isExistVar(xy1[1])) y1 = int.Parse(VL.Get(xy1[1]));
//еще +100500 строк говнокода