> Is anybody know how to use DIBdata under VB when you've got a B&W bitmap.
> My probleme is that one pixel equal one bit, so when you want to make
> something on one or more pixel you're obliged to read or write a bit in a
> And the other trouble is that when you want to scale a B&W Bitmap you're
> obliged to make an AND or OR to calculate the new pixel.
> (in a function like strechtblt).
> In the height no troubles, but in the width !!
> is anybody have an exemple to use bit level in VB ?
Sure, here's one I wrote recently (Have a look at the SetPixel1() function
at the bottom):
You can implement a GetPixel1() method in much the same way.
Rather than dealing with the 1-bit data directly though, it's far easier to
just create a 1-BPP DDB and use StretchBlt() / GetPixel() / SetPixelV() to
manipulate the data, or use GetDIBits() to read the data out at 8-BPP which
is easier and quicker to manipulate since it byte aligns (You may even want
to investigate performing a fast 1->8->1 bit conversion yourself if you're
going to be working with the data for any amount of time.)
Hope this helps,
- Microsoft Visual Basic MVP -