I was making a 2d map editor for my square tile platformer game, when I realized I could really use an image editor with its abilities to repaint adjacent pixels and many mo
public Color[][] getBitmapColorMatrix(string filePath)
{
Bitmap bmp = new Bitmap(filePath);
Color[][] matrix;
int height = bmp.Height;
int width = bmp.Width;
if (height > width)
{
matrix = new Color[bmp.Width][];
for (int i = 0; i <= bmp.Width - 1; i++)
{
matrix[i] = new Color[bmp.Height];
for (int j = 0; j < bmp.Height - 1; j++)
{
matrix[i][j] = bmp.GetPixel(i, j);
}
}
}
else
{
matrix = new Color[bmp.Height][];
for (int i = 0; i <= bmp.Height - 1; i++)
{
matrix[i] = new Color[bmp.Width];
for (int j = 0; j < bmp.Width - 1; j++)
{
matrix[i][j] = bmp.GetPixel(i, j);
}
}
}
return matrix;
}