Page 1 of 1

File in use

Posted: Fri Feb 11, 2011 1:46 pm
by bcdfbcdf1
I'm using VintaSoftImaging.NET and VintaSoftTwain.NET in the WinForm program.

The main target of the program is scanning the file and can handle simple imaging method (e.g. insert the image in the file , rotate the image , etc)

For the image from the scanner , just save the file when the image acquire like the example in faq.

And then use the list to list out the scanned file and change the imageViewer and thumbnailViewer to display them.

When I try to insert one more page in the selected file , first dispose the imageviewer of the selected file, then construct the TiffFile by the file.
But the system always pop up the file in use and throw the exception.

How can I "free" the file so that can construct the TiffFile for the image handle?

Re: File in use

Posted: Fri Feb 11, 2011 3:55 pm
by Alex
Hello,

You want to acquire images from scanner and preview acquired images in the viewer. Am I right?

Do you want to preview images when all images are acquired and saved to TIFF file or you want to preview images during scanning?

I think you do not need to use the TiffFile class - just add Bitmap's to the image collection of the image viewer and save collection as TIFF file when it will be necessary.

Best regards, Alexander

Re: File in use

Posted: Mon Feb 14, 2011 4:46 am
by bcdfbcdf1
You want to acquire images from scanner and preview acquired images in the viewer. Am I right?
-> Yes, acquire images from scanner and preview acquired images in the viewer

Do you want to preview images when all images are acquired and saved to TIFF file or you want to preview images during scanning?
-> Yes, I save all the scan image and preview it during scanning.

I think you do not need to use the TiffFile class - just add Bitmap's to the image collection of the image viewer and save collection as TIFF file when it will be necessary.
-> But I need to do the image processing include rotate the image, merge the new scan file into the exist image file, delete some pages in the file, etc.
-> Is the Bitmap can handle those image operation?

Re: File in use

Posted: Mon Feb 14, 2011 2:05 pm
by Alex
But I need to do the image processing include rotate the image, merge the new scan file into the exist image file, delete some pages in the file, etc.
Is the Bitmap can handle those image operation?
You can create a VintasoftImage object from the acquired image, process image using methods of VintasoftImage object and add the VintasoftImage object to an image collection of image viewer (imageViewer1.Images.Add(...)).

Best regards, Alexander

Re: File in use

Posted: Wed Feb 23, 2011 10:00 am
by bcdfbcdf1
You can create a VintasoftImage object from the acquired image, process image using methods of VintasoftImage object and add the VintasoftImage object to an image collection of image viewer (imageViewer1.Images.Add(...)).
How can I use VintasoftImage object add pages ?
When I use Tiff object , I can use _tiff.Pages.Insert(_page_num, _imageCollection),
for VintasoftImage what is the syntax or method should use?

Re: File in use

Posted: Wed Feb 23, 2011 12:46 pm
by Alex
Hello,

You can add VintasoftImage objects to the ImageCollection and when call the ImageCollection.Save method.

Best regards, Alexander

Re: File in use

Posted: Thu Feb 24, 2011 12:33 pm
by bcdfbcdf1
Alex wrote:Hello,

You can add VintasoftImage objects to the ImageCollection and when call the ImageCollection.Save method.

Best regards, Alexander

Dear Alex,

The method you say which I can save the new file now (without using the TiffFile class). Thanks a lot.
But the basic problem is still here. The "file in use " even I dispose the image viewer of the preview image.
I try to update file A when the image viewer previewing the file B. But the error "file in use" is still pop-up.
I can free the file when I quite the program only.
Should I need to dispose the thumbnail too?
Which method should I use to free the file?

BCDF

Re: File in use

Posted: Mon Mar 07, 2011 6:42 pm
by Alex
Hello,

Please see this example:
http://www.vintasoft.com/zip/examples/v ... rp2008.zip

Example shows how to:
  • acquire image(s) from the scanner
  • add acquired image(s) to the thumbnail and image viewer (image(s) can be saved on local disk or memory)
  • process/save acquired image(s)
Best regards, Alexander