Support Center

System.IO.IOException on TIF

Kathy Brewer Sep 06, 2012 07:02PM EDT

We are storing our images in a file folder. We have a process where we select the item which loads the file in the Viewer and have a grid where we are indicating that the file should be deleted. I am disposing of the Images in the viewer before actually performing the "delete", but every time I get this error:
System.IO.IOException: The process cannot access the file '[filename]' because it is being used by another process.

Help!!

2 Data Techniques Responses and 2 Community Responses

Up 4 Rated Down
DTI Support  Data Techniques Employee Sep 07, 2012 09:21AM EDT

Hello,

If you are opening the image using a stream to open the files, make sure you are calling Close or Dispose on the steam object otherwise the files will be opened.

If not then make sure the files arent opened elsewhere. If you use the ImageMan .Load which takes a filename then it will automatically close the file as soon as the images are loaded so that shouldn't be the issue.

Thanks for your interest in our products and please let us know if you have any questions.

Sincerely,
Sean
Data Techniques Support

Up -2 Rated Down
Kathy Brewer  Data Techniques Employee Sep 07, 2012 01:45PM EDT

Thanks. I found where it wasn't disposing the item (it was the imgstream). However, now when printing, the Viewer turns black and nothing prints. (It's one thing after another ... ) :)

Up -5 Rated Down
DTI Support  Data Techniques Employee Sep 07, 2012 01:52PM EDT

Hi Kathy,

I know some days it seems nothing works :-)

Printing shouldn't modify the images in the viewer, You just need to call the Draw method on the ImGraphics to print each page during the Print Page event handler.

You may want to look at our ImageManSampleVB solution which shows basic printing code.

Hope your day goes better!

Sean
Data Techniques Support

Up 1 Rated Down
Kathy Brewer  Data Techniques Employee Sep 13, 2012 11:04AM EDT

I got the printing to work (I was disposing an image that was still needed). Did you ever find an answer to my problem with invalid TIF format?

This question is closed to new answers.

Contact Us