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
 Saving some pages of TImageEnMView to a TIFF file

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
Elemental Posted - Dec 09 2020 : 15:29:57
Currently, I do not allow the user to select multiple pages in a TImageEnMView. However, I do allow them to export from page X to page Y. This process is very tine-consuming. A 70-page document takes 20 seconds. I can't find any more effective and efficient methods than these below. Here is my code:


procedure TForm1.ExportTiff(PageX, PageY: Integer; DestinationName: TFileName);
var
  TIFFHandler: TIETIFFHandler;
  PageIndex: Integer;
  StreamedPage: TMemoryStream;
begin
  TIFFHandler := TIETIFFHandler.Create();
  try
    for PageIndex := PageX to PageY do
    begin
      StreamedPage := TMemoryStream.Create();
      try
        iemvDocViewer.GetImageToStream( PageIndex, StreamedPage, ioTIFF );
        StreamedPage.Position := 0;
        TIFFHandler. InsertPageAsStream( StreamedPage, PageIndex );
      finally
        StreamedPage.Free;
      end;
    end;
    TIFFHandler.WriteFile( DestinationName );
  finally
    TIFFHandler.Free;
  end;
end;


As you can see, the image first has to be copied from memory in the component, to memory in a stream, and then from the stream to the TIFF file handler, and then from the file handler to disk. Can anyone offer anything faster? Again, I can't use any methods that include SelectedOnly as a parameter, because I only allow them to select one image.
1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Dec 09 2020 : 16:15:31
Hi

I'm not sure there are quicker ways to do it, unfortunately.

If you were keeping a significant portion of images, it might be quicker to copy the entire file and then just delete the unwanted ones:

https://www.imageen.com/help/DeleteTIFFImGroup.html



Nigel
Xequte Software
www.imageen.com