Re: Get RAW Bitmap Data from a file
- From: "Armin Zingler" <az.nospam@xxxxxxxxxx>
- Date: Sun, 18 May 2008 02:28:57 +0200
"RB0135" <robear@xxxxxxxxxxxxx> schrieb
Dim rawImage() As Byte = Nothing 'the image as a byte[]
You don't have to set it to Nothing because it is Nothing as you have
not assigned anything yet.
rawImage = New Byte(size - 1)
Can't compile this. The syntax above does not work. ReDim has to be
used.
but get the "PARAMETER IS INCORRECT" error message, and I know from
other posts, this is usually because the BYTE data is invalid (or
not raw), although the byte length returned is 2880 bytes, which
does equate to the width*height*8 of the image.
I'm not sure...:
You try Image.FromStream but you only have the pixel data without header
bytes. If you wanted to use Image.FromStream, you would have to use a
BinaryReader and read the whole file because only the pixel data is
insufficient. Or you have to open the Filestream and pass it to
Image.Fromstream directly. However, why don't you then use
Image.FromFile or New Bitmap("test.bmp") ? If you need pixel data,
LockBits is the right way, but what do you do want to do with the byte
array in variable rawImage? The pixel data is in it, but that's not
sufficient to be used with Image.FromStream.
Armin
.
- Follow-Ups:
- Re: Get RAW Bitmap Data from a file
- From: RB0135
- Re: Get RAW Bitmap Data from a file
- References:
- Get RAW Bitmap Data from a file
- From: RB0135
- Get RAW Bitmap Data from a file
- Prev by Date: Get RAW Bitmap Data from a file
- Next by Date: Re: HELP ME
- Previous by thread: Get RAW Bitmap Data from a file
- Next by thread: Re: Get RAW Bitmap Data from a file
- Index(es):
Relevant Pages
|
Loading