I have a structure and array.
I want to write in a file in C#.
Here is the C code.
How do I do in C#?
I already declared BITMAPFILEHEADER and BITMAPINFOHEADER.
imagearray is BYTE *
I want to write in a file in C#.
Here is the C code.
How do I do in C#?
C#:
fp = fopen (filename, "wb");
if (! fp)
{
return -1;
}
fwrite (&bfh.bfType, 1, sizeof(BITMAPFILEHEADER), fp);
fwrite (&bih.biSize, 1, sizeof(BITMAPINFOHEADER), fp);
fwrite (imagearray, 1, dwBitmapByteCount, fp);
fclose (fp);
I already declared BITMAPFILEHEADER and BITMAPINFOHEADER.
imagearray is BYTE *