I'm working on another project already that also requires navigating a stream representing multiple pages and the workaround I used before isn't going to work in my new project. Here is my setup code, where FFileHandler is of type TIETIFFHandler and FMemoryStream is of type TMemoryStream:
FFileHandler.ReadFile( FileName );
FFileHandler.WriteStream( FMemoryStream );
FMemoryStream.Position := 0;
FPageViewed := ViewPage( 0 );
Here is the code to the ViewPage function:
ImageEnVect1.IO.Params.TIFF_ImageIndex := Number;
ImageEnVect1.IO.LoadFromStreamTIFF( FMemoryStream );
Result := Number;
The solution was to add this line to the ViewPage function:
FMemoryStream.Position := 0;
That's pretty funny. But I don't work with streams a whole lot, much less rivers. :) Anyway, that's the only way I can get a TIFF Handler and an image component to talk, is either through a stream or a file and a file is too permanent and too slow.