2006.07.31 13:39 "RE: [Tiff] How to save in tiff format file?", by
I have tried the solution provided you all. It
seems that my saved file nw look distorted. Think the problem now lies in the TIFF I am reading is in different format(by Gerben Vos.). The meaning of different format, does it mean by the intilaiasation of the array when reading the tiff file?
For background info: My Gheight & Gwidth got from function which is reading the image file. And the constant XSIZE & YSIZE is defined as 256. From my understanding, I know XSIZE must be equal to my Gwidth & YSIZE is equal to Gheight. So equate them to the same value.
If you are trying to keep the original image dimensions, you should get rid of your XSIZE and YSIZE definitions, and use the dimension values from the original image (Gheight, Gwidth). But you will probably want to allocate your array dynamically, because you can't use variables to declare array bounds.
// (Gwidth and Gheight should already be set at this point)
unsigned char * array = new unsigned char[Gwidth * Gheight];
// don't forget to check if allocated okay, and also to 'delete  array' at the end of your function
Now we're starting to talk more about C/C++ than TIFF, so I'll stop here... :-)