File in use

Questions, comments and suggestions concerning VintaSoft Imaging .NET SDK.

Moderator: Alex

Post Reply
bcdfbcdf1
Posts: 4
Joined: Fri Feb 11, 2011 12:00 pm

File in use

Post by bcdfbcdf1 » Fri Feb 11, 2011 1:46 pm

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?

Alex
Site Admin
Posts: 1445
Joined: Thu Jul 10, 2008 2:21 pm

Re: File in use

Post by Alex » Fri Feb 11, 2011 3:55 pm

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

bcdfbcdf1
Posts: 4
Joined: Fri Feb 11, 2011 12:00 pm

Re: File in use

Post by bcdfbcdf1 » Mon Feb 14, 2011 4:46 am

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?

Alex
Site Admin
Posts: 1445
Joined: Thu Jul 10, 2008 2:21 pm

Re: File in use

Post by Alex » Mon Feb 14, 2011 2:05 pm

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

bcdfbcdf1
Posts: 4
Joined: Fri Feb 11, 2011 12:00 pm

Re: File in use

Post by bcdfbcdf1 » Wed Feb 23, 2011 10:00 am

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?

Alex
Site Admin
Posts: 1445
Joined: Thu Jul 10, 2008 2:21 pm

Re: File in use

Post by Alex » Wed Feb 23, 2011 12:46 pm

Hello,

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

Best regards, Alexander

bcdfbcdf1
Posts: 4
Joined: Fri Feb 11, 2011 12:00 pm

Re: File in use

Post by bcdfbcdf1 » Thu Feb 24, 2011 12:33 pm

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

Alex
Site Admin
Posts: 1445
Joined: Thu Jul 10, 2008 2:21 pm

Re: File in use

Post by Alex » Mon Mar 07, 2011 6:42 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest