I am trying to convert matric color to BitmapImage
.
I have code that converts BitmapImage
to matric color as written below but it does not work:
Bitmap b = new Bitmap(@"c:\aaa.jpg");
System.Drawing.Color[,] mat = new System.Drawing.Color[(int)b.Width, (int)b.Height];
for (int i = 0; i < b.Width; i++) {
for (int j = 0; j < b.Height; j++){
mat[i, j] = b.GetPixel(i, j);
}
}
How can I fix this?