I have a function that converts raw byte data to bitmap, to be displayed. The process is being done in an embedded platform with Windows CE 6.0. This function works. However, the conversion time is too long.
I am not sure whether the issue stems from either my logic or other reasons. Please advice.
private Bitmap GetBitMap(byte[] byImage)
{
Bitmap bm = new Bitmap(IMG_X, IMG_Y);
for (int j = 0; j < IMG_Y; j++)
{
for (int i = 0; i < IMG_X; i++)
{
int rgb = (int)byImage[i + j * IMG_X];
Color color = Color.FromArgb(rgb, rgb, rgb);
bm.SetPixel(i, j, color);
}
}
return bm;
}