[Gdal-dev] Read one band image to a bitmap in csharp

Tamas Szekeres szekerest at gmail.com
Mon Mar 12 11:52:24 EDT 2007


2007/3/12, Hallgren Johan E <jhhal at wmdata.com>:
> Thanks Tamas,
>
> Now things working! The code below is from the GDALRead.cs sample and it
> seams to be a bit slow. Is it possible to use the BitmapData/LockBitmap
> instead and would it be faster?
>

Hopefully, creating a .net image with PixelFormat = 8bppIndexed would
be faster, I haven't tested it though. It is possible to use
BitmapData/LockBitmap directly, GDALReadDirect.cs uses this approach.
In this case the palette should also be copied into the .net image.

>
> Regaring the Metadata and image extent.
>
> Does GDal provide any support for coordinate information stored in a
> world file? Or does I have to read the file myself. I hoped that GDal
> provided me with a uniform way of reading geographic information
> wherever it's stored.
>

I think DataSet.GetGeoTransform could retrieve the transormation
parameters as an array of floats (array length is 6)


Best regards,

Tamas



More information about the Gdal-dev mailing list