ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 AppendImage(Stream) single Pages for TIFF

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

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.

MStream:=TMemoryStream.create;
MStream.Position:=0;
MStream.LoadFromFile('c:\temp\tiff 2 pages.tif');
ImageEnMView.AppendImage(MStream);
MStream.Free;

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;

Note: Completely untested

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com