public static void DrawRectangle(IndexRectangle rect) { Point a = GlobUtils.GetPoint(rect.A); Point b = GlobUtils.GetPoint(rect.B); Point c = GlobUtils.GetPoint(rect.C); int topLength = b.X - a.X; int sideLength = c.Y - a.Y; for (int i = 0; i < topLength; i++) { GlobVar.GraphicsCanvas[GlobUtils.GetIndex(a.X + i, a.Y)] = (byte)120; GlobVar.GraphicsCanvas[GlobUtils.GetIndex(c.X + i, c.Y)] = (byte)120; } for (int i = 0; i < sideLength; i++) { GlobVar.GraphicsCanvas[GlobUtils.GetIndex(a.X, a.Y + i)] = (byte)120; GlobVar.GraphicsCanvas[GlobUtils.GetIndex(b.X, b.Y + i)] = (byte)120; } }