Multipage TIFF - Adjust Brightness single page via Cloning
Multipage TIFF - Adjust Brightness single page via Cloning
Hi,
I am looking to see how to adjust Brightness/Contrast on an individual page in a multipage tiff.
Perhaps I am making this more complicated than it is, however I have not worked out a method yet.
I see from the example code how the image is being cloned and then the brightness is adjusted on the cloned image, but that code then sets the viewer native image as the cloned image, which is just a single page of the image.
I have attempted after the cloning to delete the selected page in the original image and then insert the cloned image back in its place. However when I set updated image as the viewer native image, it says the image is invalid cannot get the height.
Thanks
I am looking to see how to adjust Brightness/Contrast on an individual page in a multipage tiff.
Perhaps I am making this more complicated than it is, however I have not worked out a method yet.
I see from the example code how the image is being cloned and then the brightness is adjusted on the cloned image, but that code then sets the viewer native image as the cloned image, which is just a single page of the image.
I have attempted after the cloning to delete the selected page in the original image and then insert the cloned image back in its place. However when I set updated image as the viewer native image, it says the image is invalid cannot get the height.
Thanks
Last edited by MIKES on Tue Sep 16, 2008 12:39 pm, edited 1 time in total.
Re: Multipage TIFF - Adjust Brightness on single page
Hi Mike.
First, check you are using the last fixed release.
Then, use this code to adjust brightness on the second page of multipage.tif:
Best regards,
Loïc
First, check you are using the last fixed release.
Then, use this code to adjust brightness on the second page of multipage.tif:
Code: Select all
nImageID = Imaging1.TiffCreateMultiPageFromFile("multipage.tif")
Call Imaging1.TiffSelectPage(nImageID, 2)
Imaging1.SetBrightness (10)
Call Imaging1.TiffSaveAsNativeMultiPage("multipage.tif")
Loïc
Re: Multipage TIFF - Adjust Brightness on single page
Yes I had already tried that. (I have to try it with a negative value...)
For UNDO purposes, I'd still like to know if I should be able to clone an image, delete the page in the original, then reinsert the clone.
My GdPicture version is a week or two old.
I will try the current version as asked.
For UNDO purposes, I'd still like to know if I should be able to clone an image, delete the page in the original, then reinsert the clone.
My GdPicture version is a week or two old.
I will try the current version as asked.
Re: Multipage TIFF - Adjust Brightness single page via Cloning
OK,
I suggest you to use the CreateClonedImageI() method instead the CreateClonedImage().
If you use the CreateClonedImage() method, the cloned image is released from the memory when you release the image source.
Best regards,
Loïc
I suggest you to use the CreateClonedImageI() method instead the CreateClonedImage().
If you use the CreateClonedImage() method, the cloned image is released from the memory when you release the image source.
Best regards,
Loïc
Re: Multipage TIFF - Adjust Brightness single page via Cloning
Hi,
I have started having some success with the cloning process, playing with it enough to grasp what was actually happening in the images has helped.
Some observations I have had during the process.
1) I have not been able to find a method to make a copy of an entire multipage tiff.
I had thought .TiffCreateMultiPageFromGdPictureImage would do so, but it only creates copy of a single page, like Clone does. My reason for this is to have an Original that I could revert back to undo all changes and also to undo changes to individual pages. I suppose I could just go back and re-read the file. Currently my solution is to make two images when the file is opened
Then again, re-reading the file will not work if the image a bunch of scanned pages, that have not yet been saved (or accepted as a valid scan.)
I have started having some success with the cloning process, playing with it enough to grasp what was actually happening in the images has helped.
Some observations I have had during the process.
1) I have not been able to find a method to make a copy of an entire multipage tiff.
I had thought .TiffCreateMultiPageFromGdPictureImage would do so, but it only creates copy of a single page, like Clone does. My reason for this is to have an Original that I could revert back to undo all changes and also to undo changes to individual pages. I suppose I could just go back and re-read the file. Currently my solution is to make two images when the file is opened
Code: Select all
nTiffOriginal = AxImaging1.CreateImageFromFile(OpenFileDialog1.FileName)
nTiffModified = AxImaging1.CreateImageFromFile(OpenFileDialog1.FileName)
Last edited by MIKES on Wed Sep 17, 2008 8:18 pm, edited 1 time in total.
Who is online
Users browsing this forum: Google [Bot] and 1 guest