Re: Get RAW Bitmap Data from a file
- From: "Armin Zingler" <az.nospam@xxxxxxxxxx>
- Date: Sun, 18 May 2008 09:54:41 +0200
"RB0135" <robear@xxxxxxxxxxxxx> schrieb
Thanks for your reply..
The code I used and presented in the original post was from the MS
Robotic Lib SDK and does compile OK..
I understand your point about the redim, but mine compiles fine
without it...
Strange. I tried it in VB 2008 Express and, as I expected, the syntax is
not valid because, in VB, in opposite to C#, there is no "[]" for
arrays. Therefore, "New Byte(size -1)" is interpreted as a constructor,
but a Byte does not have such a constructor.
Are you really using VB.Net? ;-)
The part of code using the MemoryStream and a picture box, was
another Idea I was testing to get the bytes, but it is not relevant
to the overall issue.
The various bits of code are tests I am trying to do to get PIXEL
DATA in the right format and the right data from the BMP file.
The data is transferred to the Roll Printer in Bytes, where it
interperets it. Each bit is on or off.
All this is explained in the original post.
Not this way, nevertheless I got it now.
Thats what I need the rawimage data to be.. A bit representation of
the image from the BMP file.. I dont want the header information,
just, I suppose, what the image looks like in Bytes.
Does this make sense?
Yes, but you don't show how you pass it to the roll printer.
From your reply, the lockbits is the right way to go, but I am not
getting the representation needed from the file.
How do you check this? I don't see any code that prints anything.
I have read that BMP's store the data from bottom to top, left to
right (or similar).. Is this the case?
Do I need more processing of the rawimage data to get the
representation of the image from it?
I can only guess that you expect one byte per pixel, but you specified
Imaging.PixelFormat.Format1bppIndexed as the format which means one bit
per pixel (1 byte = 8 pixel). I don't know how you process the data in
rawImage. In addition, IIRC, there is no indexed bitmap support in a
certain area that I unfortunatelly don't remember currently.
It's always good to have a look here:
http://www.bobpowell.net/
In the GDI+ FAQs, there is an example of creating a 1bpp image. There is also something about directly accessing pixel data. Maybe this helps in any way, too.
And we have m.p.d.framework.drawing.
Though, I'm still interested in how you really process 'rawImage'.
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
- Re: Get RAW Bitmap Data from a file
- From: Armin Zingler
- Re: Get RAW Bitmap Data from a file
- From: RB0135
- Get RAW Bitmap Data from a file
- Prev by Date: Re: disappointed
- Next by Date: Re: Setup: OCX and DLLs
- Previous by thread: Re: Get RAW Bitmap Data from a file
- Next by thread: Re: Get RAW Bitmap Data from a file
- Index(es):
Relevant Pages
|