i converted the output XImage of my code to Bitmap, but the output file is massive, so i thought about compressing it using lzrw
i use this code to write the bitmap to file
fwrite(&bmpFileHeader, sizeof(bmpFileHeader), 1, fp);
fwrite(&bmpInfoHeader, sizeof(bmpInfoHeader), 1, fp);
fwrite(pImage->data, 4*pImage->width*pImage->height, 1, fp);
is there anyway i could write it to a (char *) insted of (FILE *) so i can use lzrw compression on it?
or even better, some way to convert the XImage to PNG directly…
thanks;
Use
memcpyinstead offwriteEDIT: I update code, thaks @bdk for pointing out