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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 save couple of tiffs to one file
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

croudo

Israel
4 Posts

Posted - Apr 16 2015 :  05:34:48  Show Profile  Reply
hi there
i work with scanner, and when i scan on multi pages i want to save them to one tiff file.
now i know how to save each page to a different file:

procedure TfdmScan.ImageEnMIOAcquireBitmap(Sender: TObject;
  ABitmap: TIEBitmap; var Handled: Boolean);
var
  f:TMemoryStream;
begin
   try
    f:=TMemoryStream.create;
    f.Position:=0;
    FileInThisScanCounter:=FileInThisScanCounter+1;
    ForceDirectories(DirToScanInto);
    ABitmap.VclBitmap.SaveToFile(DirToScanInto+remark+IntToStr(FileInThisScanCounter)+'.tif');
    ShellShowDirectory(DirToScanInto);
    if fProgress.breakFlag then exit;
    Application.ProcessMessages;
  finally
    f.Free;
  end;
end;


thanks
croudo assaf

CroudoMan

xequte

38510 Posts

Posted - Apr 16 2015 :  15:15:11  Show Profile  Reply
Hi

To create a multi-page TIFF file, either use a TImageEnMView or the TIETIFFHandler class:

http://www.imageen.com/help/TIETIFFHandler.html

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

croudo

Israel
4 Posts

Posted - Apr 19 2015 :  02:45:47  Show Profile  Reply
hi nigel
can u give me some example?
thankss for the attention
croudo assaf

CroudoMan
Go to Top of Page

w2m

USA
1990 Posts

Posted - Apr 19 2015 :  09:59:00  Show Profile  Reply
There is a TIFHandler demo in the Demos\InputOutput\TifHandler folder.
There are a number of TImageEnMView demos in the Demos\Multi folder.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

croudo

Israel
4 Posts

Posted - Apr 21 2015 :  06:59:53  Show Profile  Reply
hii
sorry but, in the example:
// insert a new page from an external file
mytif := TIETIFFHandler.Create('input.tif');
mytif.InsertPageAsFile('external.jpg', 0);
mytif.WriteFile('output.tif');
mytif.free;

there is in a option for sending parameter in the create method:
mytif := TIETIFFHandler.Create('input.tif');

and when i try to work like in the example i get an error:
"to many actual parameters"


CroudoMan
Go to Top of Page

w2m

USA
1990 Posts

Posted - Apr 21 2015 :  13:38:08  Show Profile  Reply
Nigel may have some ideas. I do not see what the problem is.

Meanwhile, if you model your scanner app based on the AquireAll demo that uses the TImageEnMView component you will be much better off. This demo is located in the ..\ImageEn\Demos\ImageAcquisition\AllAcquire folder. All you have to do is add a button called Save1 and then add ImageEnMView1.MIO.SaveToFile(AFilename) to the Save1Click event and save the file as a tif file. The resulting tif file will have all the images present in TImageEnMView.
procedure TfrmMain.Save1Click(Sender: TObject);
{ Save the all the images as a multi-frame tif file. }
var
  iFilename: string;
begin
  SavePictureDialog1.DefaultExt := 'tif';
  SavePictureDialog1.Filename := 'Untitled.tif';
  if SavePictureDialog1.Execute then
  begin
    Screen.Cursor := crHourglass;
    try
      iFilename := SavePictureDialog1.Filename;
      ImageEnMView1.MIO.SaveToFile(iFilename);
    finally
      Screen.Cursor := crDefault;
    end;
  end;
end;

This is probably the best way to save a multi-frame tif file. TImageEnMView is the best component to use to save multi-frame files because that is what it was designed for.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

w2m

USA
1990 Posts

Posted - Apr 22 2015 :  14:05:23  Show Profile  Reply
It seems like there is not a simple demo that shows how to use TImageEnMView to open, add frames, insert frames, delete frames, replace frame, save, saveas, and export frames so I added one to the User Demos page. You may download it here:
http://www.xecute.com/ieforum/topic.asp?whichpage=3&TOPIC_ID=1446#7720
or here http://www.xecute.com/ieforum/attach/w2m/2015422142359_Multiframe.zip

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

croudo

Israel
4 Posts

Posted - Apr 27 2015 :  05:38:45  Show Profile  Reply
hii miller
may be i didnt explain my self well (sorry for my english)
i have two tiff files (firstFile.tif and secondFile.tif)
all i want to do is create thirdFile.tif that combine between firstFile.tif and secondFile.tif (multi pages).
i hope i succeed to explain my self now :)
sorry for the trouble :/
thankss for the attention

CroudoMan
Go to Top of Page

w2m

USA
1990 Posts

Posted - Apr 27 2015 :  07:31:47  Show Profile  Reply
You can do just that with the demo. That is the whole point of the demo. Open the first file and then select the Add button to add the second file then and position it with the mouse to where you want it to be or select the INSERT button to insert the second file to the item before the selected frame. Finally, save the tif file.

The demo allows Adding, Inserting, Extracting, Replacing or Deleting frames in TIF, GIF and Icon file.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: