Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
T O P I C R E V I E W
Ralf
Posted - Jan 19 2017 : 04:26:09 Hallo,
i use AppendImage(Stream) to insert Images into a ImageenMView. For AppendImage(File) i found in the help a syntax to insert only the pages i want
// Append all pages of a TIFF to the current content
iPageCount := EnumTIFFIm( sFileName );
for I := 0 to iPageCount - 1 do
ImageEnMView1.AppendImage( sFileName + IEM_Path_Index_Delimiter + IntToStr( I ));
Can i do the same when i use a Stream? Or is there a function to get every Page from a TIFF Stream Like for example GetTiffPage(MStream,idx,PageStream).
Thanks Ralf
3 L A T E S T R E P L I E S (Newest First)
Ralf
Posted - Jan 20 2017 : 04:43:36 Hi Nigel,
your Idear is working with one correction:
io := TImageEnIO.Create(nil);
if io.ParamsFromStream( stream ) then
begin
totalFrames:=io.params.imagecount;
for i : 0 to totalFrames do
if WantFrame( i ) do
begin
stream.Position := 0;
io.Params.ImageIndex := i;
io.LoadFromStream( stream );
ImageEnMView1.AppendImage( io.IEBitmap );
end;
...
Thanks Best regards
Ralf
Ralf
Posted - Jan 20 2017 : 03:58:43 Hi Nigel,
i also tried to load the complete Multipage Tiff at once. The Result was that only one Page was loaded. Hier what i tried. Normale the Screen is not a file on Disk it comes from Database.
I want to give the customer the posibility to load more than one Tiff or other image in an ImageEnMView.
I try your example and give a feedback.
Thanks Ralf
xequte
Posted - Jan 19 2017 : 18:37:00 Hi Ralf
Unfortunately, only a complete TIFF file can be loaded directly into a TImageEnMView via a stream. You would need to do something like:
io := TImageEnIO.Create(nil);
totalFrames := io.ParamsFromStream( stream );
for i : 0 to totalFrames do
if WantFrame( i ) do
begin
stream.Position := 0;
io.Params.ImageIndex := i;
io.LoadFromStream( stream );
ImageEnMView1.AppendImage( io.IEBitmap );
end;