I want to read a pbm (portable bitmap format) image having depth one bit per pixel and store that data in a file, so I can perform some operation on bits.
I think in C# the smallest data that can be read is 1 byte so how can I read a bit?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t read a bit directly. But you can read a byte and then get the bits from that byte. Or, better yet, read a bunch of bytes into an array and then create a BitArray.
Or … is this “portable bitmap format” supported directly by the Bitmap class?
Bitmapdoes support a 1 bit per pixel format. It might be as simple as calling theBitmapconstructor to load from a file or a stream.More information on your problem will get you a better answer.