[gdal-dev] Problem with GDALDatasetRasterIO.cs and ECW files
Francisco José Reyes Peralta
gistdt08 at hotmail.es
Tue Apr 19 06:56:30 EDT 2011
The parameter is not valid is the error that I get.I use an adaptation of the source .cs code in VB.NET.Here is part of the code:
Dim pixelFormat As PixelFormat Dim dataType As DataType
Dim pixelSpace As Integer
If isIndexed Then
pixelFormat = PixelFormat.Format8bppIndexed
dataType = DataType.GDT_Byte
pixelSpace = 1
Else
If channelCount = 1 Then
If channelSize > 8 Then
pixelFormat = PixelFormat.Format16bppGrayScale
dataType = DataType.GDT_Int16
pixelSpace = 2
Else
pixelFormat = PixelFormat.Format24bppRgb
channelCount = 3
dataType = DataType.GDT_Byte
pixelSpace = 3
End If
Else
If hasAlpha Then
If channelSize > 8 Then
pixelFormat = PixelFormat.Format64bppArgb
dataType = DataType.GDT_UInt16
pixelSpace = 8
Else
pixelFormat = PixelFormat.Format32bppArgb
dataType = DataType.GDT_Byte
pixelSpace = 4
End If
channelCount = 4
Else
If channelSize > 8 Then
pixelFormat = PixelFormat.Format48bppRgb
dataType = DataType.GDT_UInt16
pixelSpace = 6
Else
pixelFormat = PixelFormat.Format24bppRgb
dataType = DataType.GDT_Byte
pixelSpace = 3
End If
channelCount = 3
End If
End If
End If
And the Error is in the following line:
Dim bitmap As New Bitmap(imageWidth, imageHeight, pixelFormat__1)
Is possible to read the dataset and write to a bitmap or picturebox without save as file?
Thanks for your reply.
Francisco J.
2011/4/19 Francisco José Reyes Peralta <gistdt08 at hotmail.es>
> Dear friends, I'm vieweing the *GDALDatasetRasterIO.cs* from the Csharp
> samples of GDAL and I'm getting an error in the following line *Bitmap
> bitmap = new Bitmap(imageWidth, imageHeight, pixelFormat);* In the *
> pixelFormat* argument.
>
Hi,
What is the error message specifically?
Best regards,
Tamas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20110419/cc8baab2/attachment-0001.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20110419/73155457/attachment.html
More information about the gdal-dev
mailing list