Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Extracting individual bits from a byte


i'm trying to get the data out of a monochrome bmp file which has one bit per
pixel. I can read the byte containing 8 consecutive pixels but I'm getting
tied in knots trying to find the most efficient way of reading the individual
bits into an array.

Grateful for advice
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default Extracting individual bits from a byte


This might give you some hints:

http://support.microsoft.com/default.aspx/kb/113476

HTH,

Eric

"simonc" wrote:

i'm trying to get the data out of a monochrome bmp file which has one bit per
pixel. I can read the byte containing 8 consecutive pixels but I'm getting
tied in knots trying to find the most efficient way of reading the individual
bits into an array.

Grateful for advice

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Extracting individual bits from a byte


Thanks for this. It turns out And is the key.

To extract the eight bits of a byte I used

for i = 0 to 7
bit(i) = byte And 2^i
next

"EricG" wrote:

This might give you some hints:

http://support.microsoft.com/default.aspx/kb/113476

HTH,

Eric

"simonc" wrote:

i'm trying to get the data out of a monochrome bmp file which has one bit per
pixel. I can read the byte containing 8 consecutive pixels but I'm getting
tied in knots trying to find the most efficient way of reading the individual
bits into an array.

Grateful for advice

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default Extracting individual bits from a byte


And here is another one:

http://support.microsoft.com/kb/185554

"simonc" wrote:

i'm trying to get the data out of a monochrome bmp file which has one bit per
pixel. I can read the byte containing 8 consecutive pixels but I'm getting
tied in knots trying to find the most efficient way of reading the individual
bits into an array.

Grateful for advice

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Extracting individual bits from a byte


What kind of array are you trying to put it into and how many dimensions
does the array have, one or two (if one, how is the data laid out, column
first or row first)?

--
Rick (MVP - Excel)


"simonc" wrote in message
...
i'm trying to get the data out of a monochrome bmp file which has one bit
per
pixel. I can read the byte containing 8 consecutive pixels but I'm getting
tied in knots trying to find the most efficient way of reading the
individual
bits into an array.

Grateful for advice




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
3 bits of data BimboUK Excel Discussion (Misc queries) 2 June 16th 09 03:19 AM
How to match bits to a certain value Matt Excel Worksheet Functions 1 August 23rd 06 06:24 AM
Extracting Comma Seperated data into individual Cells Rmcnaught Excel Discussion (Misc queries) 2 July 18th 06 09:04 PM
BIN2DEC bits 0-5 then 6-15 Jim Excel Worksheet Functions 5 May 28th 06 06:24 PM
Manipulating bits Sunny[_4_] Excel Programming 1 June 3rd 04 06:13 PM


All times are GMT +1. The time now is 02:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"