Encoding images

Two functions encode images:

BOOL CALLBACK EncodeTiffImage(TIFFFILE hChain, int nImage,
LONG lParam, FILLPROC lpLineFn)

BOOL CALLBACK EncodeCcittImage(int nFile, WORD wWidth, WORD wHeight,
DWORD dwCompression,
LONG lParam, FILLPROC lpLineFn)

Function Descriptions

Both functions are similar to the decoding functions. Before calling EncodeCcittImage() you should open a file for writing, and perhaps you should output the image header. The file pointer must point to the first position where EncodeCcittImage() must place the first code byte.

The line functions must pass the image to the function line-by-line in a DIB format. You can simply modify the example line functions in the preceding Decoding Images section, replacing SetDIBits() with GetDIBits(), or _lwrite() with _lread().