Load, change and save image to the same file in Image Viewer
Moderator: Alex
Load, change and save image to the same file in Image Viewer
Image Viewer Demo was created to demonstrate the main features of VintaSoftImaging.NET SDK. Demo allows to open a few image files and work with them as with the single collection, therefore demo allows to save collection to a new file only.
If you work with the single image file only and want to load image(s) from file, change image(s) and save it(them) to the same file, you should do the following steps:
1. Load image from the source file
2. Change image
3. Save image to temporary file
4. Close the source file
5. Delete the source file
6. Rename temporary file
If you work with the single image file only and want to load image(s) from file, change image(s) and save it(them) to the same file, you should do the following steps:
1. Load image from the source file
2. Change image
3. Save image to temporary file
4. Close the source file
5. Delete the source file
6. Rename temporary file
Re: Load, change and save image to the same file in Image Viewer
How do you close the source file? I tried using the dispose method, but something still has the file locked and this throws an error when I try to delete the source file as directed below.
Thanks,
Shane
Thanks,
Shane
Re: Load, change and save image to the same file in Image Viewer
Hello Shane,
Best regards, Alexander
Yes, you are right. Version 4.0 of library allows to load, change and save image to the same file, please wait only some days.If you work with the single image file only and want to load image(s) from file, change image(s) and save it(them) to the same file, you should do the following steps...
Best regards, Alexander
Re: Load, change and save image to the same file in Image Viewer
Unless I'm totally missing it, this still doesn't seem to work. I still get the error that the file is locked (The process cannot access the file 'C:\Temp\ImagingProjectsSystem\WORKING\WorkingFile.tif' because it is being used by another process.)
This is the code bit I pulled from the ImageViewer example project. I have tried it this way and by doing viewer.Images.SaveAsync(sFileName)... both give the same error.
Any ideas?
This is the code bit I pulled from the ImageViewer example project. I have tried it this way and by doing viewer.Images.SaveAsync(sFileName)... both give the same error.
Code: Select all
If viewer.FocusedImage.IsChanged = True Then
viewer.FocusedImage.Save(filename)
End If
Any ideas?
Re: Load, change and save image to the same file in Image Viewer
Hello,
Sorry for a delay. Current version of SDK allows to save image to the same file if:
Best regards, Alexander
Sorry for a delay. Current version of SDK allows to save image to the same file if:
- file is single page file and image is changed
- file is multipage file and all images of multipage file are changed
Best regards, Alexander
Re: Load, change and save image to the same file in Image Viewer
Thanks Alex. So it sounds like the code bit " viewer.FocusedImage.Save(filename)" is the right way to go with saving. I'm assuming this saves the current page back into the multipage source file. This will be a good addition if that is the case. Some of our files are 200+ pages long, so only saving the pages that are changed will be a huge time saver.
Any idea on how long until the release of 4.1?
Any idea on how long until the release of 4.1?
Re: Load, change and save image to the same file in Image Viewer
Hello Shane,
Best regards, Alexander
Version 4.1 will be available in 1-2 weeks.Any idea on how long until the release of 4.1?
Best regards, Alexander
-
- Posts: 8
- Joined: Wed Apr 02, 2014 3:08 am
Re: Load, change and save image to the same file in Image Vi
I am getting the same error:
The process cannot access the file 'i:\images\1\440\1499487.tif' because it is being used by another process
I open a file, rotate it then try to save it:
Me.ImageViewer1.Image = New Vintasoft.Imaging.VintasoftImage(filename)
...
ImageViewer1.Image.Save(filename)
The process cannot access the file 'i:\images\1\440\1499487.tif' because it is being used by another process
I open a file, rotate it then try to save it:
Me.ImageViewer1.Image = New Vintasoft.Imaging.VintasoftImage(filename)
...
ImageViewer1.Image.Save(filename)
Re: Load, change and save image to the same file in Image Vi
Hello,
Please read this article:
http://www.vintasoft.com/docs/vsimaging ... mages.html
The article contains the example which shows how to open TIFF file, rotate the second page of TIFF file and save changes in TIFF file.
Best regards, Alexander
Please read this article:
http://www.vintasoft.com/docs/vsimaging ... mages.html
The article contains the example which shows how to open TIFF file, rotate the second page of TIFF file and save changes in TIFF file.
Best regards, Alexander
Re: Load, change and save image to the same file in Image Viewer
Hello,
i'm running into the same problem, using the image collection of an ImageViewer-control:
This code runs to the last statement, where it blocks the execution (dead lock?). When i set "SaveAndSwitchSource" to false, i get the In-Use-Exception. Changing the code to FileStream-usage as in the linked example results in the same blocking behaviour.
Is it possible to save changes in an ImageViewer-imagecollection, without the tempfile-workaround?
Using the code-example "Imaging Demo" this saving works somehow, but i'm not sure, why, as the saving process itself seems to be the same as above.
Thank you in advance for your help.
Best regards,
Daniel
i'm running into the same problem, using the image collection of an ImageViewer-control:
Code: Select all
Vintasoft.Imaging.Codecs.Encoders.TiffEncoder teTest;
this.imageViewer1.Images.Add(@"c:\test\test.tif", false);
this.imageViewer1.Images[0].Rotate(90);
teTest = new Vintasoft.Imaging.Codecs.Encoders.TiffEncoder();
teTest.SaveAndSwitchSource = true;
this.imageViewer1.Images.SaveSync(@"c:\test\test.tif", teTest);
Is it possible to save changes in an ImageViewer-imagecollection, without the tempfile-workaround?
Using the code-example "Imaging Demo" this saving works somehow, but i'm not sure, why, as the saving process itself seems to be the same as above.
Thank you in advance for your help.
Best regards,
Daniel