[gdal-dev] how can use gdalce.dll and gdalce_i.lib in vc2005 smart device application to open image(tif)?

Tom Kazimiers 2voodoo at gmx.de
Mon Sep 22 06:51:43 EDT 2008


Hi there,

I am working with GDAL and WinCE, too. Currently also to display
TIFF-Images. I do it manly how it is described here:
http://www.gdal.org/gdal_tutorial.html
That is:
GDALRegister_GTiff();
GDALDataset *poDataset = (GDALDataset *) GDALOpen(pszFileName,
GA_ReadOnly );

Now you could get a band of the image file - band 1 (indexing starts
with 1 here!) for example:
GDALRasterBand *poBand = poDataset->GetRasterBand( 1 );

After this you could get information about the color table:
GDALColorTable * ct = poBand->GetColorTable();

check for example if it is RGB:
if (ct->GetPaletteInterpretation() != GPI_RGB) { }

or get the size:
int nXSize = poBand->GetXSize();
int nYSize = poBand->GetYSize();

Reading data is accompished with RasterIO - but this is too complex for
a two-line example (at least in my code base :P) - so read the
documentation on this.

Hope this helps.

@Mateusz: Have you found time during the last couple of month to take a
look into the Tiff issue regarding CCITTFax compression? I think the
last discussion about this was on the 18.02.2008 :)
I could, if you want, send you again a test file (if you do not have the
one I mailed to you anmore).

Thanks,
Tom



liu_daojie schrieb:
> *hello*:
> I have tried to use gdalce.dll and gdalce_i.lib in vc2005 smart device
> application to open image(tif)?,but I can not get the best way ,can
> you help me?
> thanks
>
>
> ------------------------------------------------------------------------
> [¹ã¸æ] ÎÄ»¯ÖØÕò ¾ªÏÖ±ðÊû
> <http://popme.163.com/link/003984_0919_8949.html>
> ------------------------------------------------------------------------
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev



More information about the gdal-dev mailing list