[gdal-dev] Problem with GDALDatasetRasterIO.cs and ECW files
Chaitanya kumar CH
chaitanya.ch at gmail.com
Tue Apr 19 10:00:27 EDT 2011
Francisco,
Can you provide the whole file?
2011/4/19 Francisco José Reyes Peralta <gistdt08 at hotmail.es>
> 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 <http://lists.osgeo.org/mailman/listinfo/gdal-dev>>
>
> >* 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
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
--
Best regards,
Chaitanya kumar CH.
/tʃaɪθənjə/ /kʊmɑr/
+91-9494447584
17.2416N 80.1426E
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20110419/710cd667/attachment-0001.html
More information about the gdal-dev
mailing list