public Bytearray ToBytearray() { Bytearray ba = new Bytearray(); ba.Resize(Width, Height); int yput; for (int y = 0; y < Height; y++) { yput = Height - y - 1; for (int x = 0; x < Width; x++) ba.Put(x, yput, Get(y, x)); } return ba; }