Quote Originally Posted by MaCrOs View Post
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
byte[,,] TibiaMap;
private void button1_Click(object sender, EventArgs e)
{
string Path = Environment.GetFolderPath(Environment.SpecialFolde r.ApplicationData) + "\\Tibia\\Automap\\";
int StartX = 31744;
int StartY = 30976;
int MaxHeight = 2048;
int MaxWidth = 2048;
TibiaMap = new byte[16, 2048, 2048];
DirectoryInfo di = new DirectoryInfo(Path);
for (int z = 0; z < 16; z++)
{
FileInfo[] mapFiles = di.GetFiles("1??1??" +
z.ToString("00") +
".map");
foreach (FileInfo inf in mapFiles)
{

Location RealLocation = MapFileNameToLocation(inf.Name);
int ArrayX = RealLocation.X - StartX;
int ArrayY = RealLocation.Y - StartY;


byte[] ColorArray = new byte[65536];
FileStream fs = new FileStream(inf.FullName, FileMode.Open);
BufferedStream bs = new BufferedStream(fs);
bs.Read(ColorArray, 0, 65536);
int index = 0;
for (int x = 0; x < 256; x++)
{
for (int y = 0; y < 256; y++)
{
TibiaMap[z, x + ArrayX,y + ArrayY] = ColorArray[index];
index += 1;
}
}

fs.Close();
}
}

}
private Location MapFileNameToLocation(string fileName)
{
Location l = new Location(0, 0, 0);
if (fileName.Length == 12 || fileName.Length == 8)
{
l.X = Int32.Parse(fileName.Substring(0, 3)) * 256;
l.Y = Int32.Parse(fileName.Substring(3, 3)) * 256;
l.Z = Int32.Parse(fileName.Substring(6, 2));
}
return l;
}
}
}

-----------------------------------------------------------------------
Declarate of Location? plz


log:

Error 1 'System.Windows.Forms.Form.Location' is a 'property' but is used like a 'type'
Location l = new Location(0, 0, 0);
that's your problem. You need to add the using statement or reference the library for whatever namespace Location is, because it isn't recognizing Location as an object/data type/whatever