[gdal-dev] Problem with GDALDatasetRasterIO.cs and ECW files

Francisco José Reyes Peralta gistdt08 at hotmail.es
Tue Apr 19 10:41:54 EDT 2011


Sorry, tomorrow in the morning pass you the entire code and the value of pixelFormat__1 because the code is in my office.
Thanks for your reply.
Francisco J.
Date: Tue, 19 Apr 2011 16:10:27 +0200
Subject: Re: [gdal-dev] Problem with GDALDatasetRasterIO.cs and ECW files
From: szekerest at gmail.com
To: gistdt08 at hotmail.es
CC: gdal-dev at lists.osgeo.org

Not sure what is the actual value of 'pixelFormat__1' in your program.

Best regards,

Tamas


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>

>  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


 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20110419/355f992c/attachment.html


More information about the gdal-dev mailing list