After i've tried to update a vb 6.0 project to vb.net, using visual studio utility,i can't read correctly data bytes from a .bmp file to insert them in a matrix to operate on.
Using vb 6.0 the code was based on Get function:
GET #1, PIXELSTART, PHOTO.MATRIX
where PHOTO is a structure data type, with a member MATRIX previously defined in this way:
ReDim PHOTO.MATRIX(1 TO PHOTO.WIDTH*3,1 TO PHOTO.HEIGHT)
in this way,the program read bytes starting from PIXELSTART in bmp file and put them in transpose matrix resultant.
For example:
an image of 622*277 pixel has a matrix of 1868*277 bytes considering 24 bit depth and so 3 bytes per pixel.
With Get function the bidimensional array,the matrix, was filled correctly, as visible using debugger, with the single pixel value of the bitmap.
Using vb.net, the utility tansformed the code in this way:
ReDim PHOTO.MATRIX(PHOTO.WIDTH*3,PHOTO.HEIGHT)
FILEGET(1,PHOTO.MATRIX(PHOTO.WIDTH*3,PHOTO.HEIGHT),STARTPIXEL)
I know the fact that the array in enumerated in different ways in vb 6.0 and .net(start with 0 in net,with 1 in 6.0), but the big big problem is that THE MATRIX HERE IS FILLED WITH NOTHING!!!Every matrix value is equal to zero, and it result in a black image!
The dimensions of the bitmap however are read correctly from bmp file in this way:
FILEGET(1,WIDTH,19)
FILEGET(1,HEIGHT,23)
Some help please!!!
Using vb 6.0 the code was based on Get function:
GET #1, PIXELSTART, PHOTO.MATRIX
where PHOTO is a structure data type, with a member MATRIX previously defined in this way:
ReDim PHOTO.MATRIX(1 TO PHOTO.WIDTH*3,1 TO PHOTO.HEIGHT)
in this way,the program read bytes starting from PIXELSTART in bmp file and put them in transpose matrix resultant.
For example:
an image of 622*277 pixel has a matrix of 1868*277 bytes considering 24 bit depth and so 3 bytes per pixel.
With Get function the bidimensional array,the matrix, was filled correctly, as visible using debugger, with the single pixel value of the bitmap.
Using vb.net, the utility tansformed the code in this way:
ReDim PHOTO.MATRIX(PHOTO.WIDTH*3,PHOTO.HEIGHT)
FILEGET(1,PHOTO.MATRIX(PHOTO.WIDTH*3,PHOTO.HEIGHT),STARTPIXEL)
I know the fact that the array in enumerated in different ways in vb 6.0 and .net(start with 0 in net,with 1 in 6.0), but the big big problem is that THE MATRIX HERE IS FILLED WITH NOTHING!!!Every matrix value is equal to zero, and it result in a black image!
The dimensions of the bitmap however are read correctly from bmp file in this way:
FILEGET(1,WIDTH,19)
FILEGET(1,HEIGHT,23)
Some help please!!!