Multipage TIFF - Adjust Brightness single page via Cloning

Example requests & Code samples for GdPicture Toolkits.
Post Reply
MIKES
Posts: 49
Joined: Thu Jul 31, 2008 8:03 pm
Location: Michigan

Multipage TIFF - Adjust Brightness single page via Cloning

Post by MIKES » Sun Sep 14, 2008 11:56 pm

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
Last edited by MIKES on Tue Sep 16, 2008 12:39 pm, edited 1 time in total.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Multipage TIFF - Adjust Brightness on single page

Post by Loïc » Tue Sep 16, 2008 9:55 am

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:

Code: Select all

nImageID = Imaging1.TiffCreateMultiPageFromFile("multipage.tif")
Call Imaging1.TiffSelectPage(nImageID, 2)
Imaging1.SetBrightness (10)
Call Imaging1.TiffSaveAsNativeMultiPage("multipage.tif")
Best regards,

Loïc

MIKES
Posts: 49
Joined: Thu Jul 31, 2008 8:03 pm
Location: Michigan

Re: Multipage TIFF - Adjust Brightness on single page

Post by MIKES » Tue Sep 16, 2008 12:38 pm

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.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Multipage TIFF - Adjust Brightness single page via Cloning

Post by Loïc » Tue Sep 16, 2008 1:39 pm

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

MIKES
Posts: 49
Joined: Thu Jul 31, 2008 8:03 pm
Location: Michigan

Re: Multipage TIFF - Adjust Brightness single page via Cloning

Post by MIKES » Wed Sep 17, 2008 4:50 pm

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

Code: Select all

nTiffOriginal = AxImaging1.CreateImageFromFile(OpenFileDialog1.FileName)
nTiffModified = AxImaging1.CreateImageFromFile(OpenFileDialog1.FileName)
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.)
Last edited by MIKES on Wed Sep 17, 2008 8:18 pm, edited 1 time in total.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests