I am trying to create a 2-D array of integer triplets R, G and B using the following code:
BitmapColours [,] PrevImage = new BitmapColours [1, 1];
public class BitmapColours
{
public int R { get; set; }
public int B { get; set; }
public int G { get; set; }
}
but when I try to set a triplet value using
PrevImage[0,0].R = -1;
I get the error "Object Reference not set to an instance of the Object"