Q - When I output a HIF image there appears to be 8 pixels at the beginning of the image that are not correct and the image appears to be shifted, what is wrong?

A - There is an 8 byte header at the beginning of the HIF file that includes the length of the image. You therefore need to add 8 to the start memory location before outputting the HIF to the screen otherwise the length is output as though it is part of the image data.

An example of doing this is shown below:

if ( i < (TotalGraphics - 1) )
MemAddressOffset = MemAddressOffset + (ScreenPtr->GfxData[i].imagewidth * ScreenPtr->GfxData[i].imageheight * ScreenPtr->BytesPerPixel);

MemAddressOffset += 8;