Thread: Bits byte

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #31
    Registered User Azmeos's Avatar
    Join Date
    Jun 2003
    Posts
    65
    Thanks guys, for helping me... however... when I tried JawiB's code, it runs each one 7 times... which I don't want. it should run it once, checking through each one 7 times. here's the updated code...

    PHP Code:
            unsigned char mask[] = {0x800x400x200x100x080x040x020x01};

            
    int binValue 0;
            
    int j 0;
            
    int stride = (imageWidth 7) / 8;
            
    unsigned charrowBuff, *pixByte;

            for(
    int k=0imageLengthk++)
            {
                
    rowBuff buf stride k;
                for(
    int i=0imageWidthi++)
                {
                    
    pixByte rowBuff + (8);
                    
                    
    cout << " -" << (int)*pixByte << "-" << endl;

                    if(
    70;                            
                    
    binValue = ((*pixByte mask[j]) ? );
                    
    cout << binValue;
                    
    j++;
                }
                
    cout << endl;
            } 
    Is my mask wrong? Or is something else wrong?

    By the way... I am getting strange results for (int)*pixByte ... sometimes I will get something like one of these: 31, 13, 30, or 63. The rest are 0s and 255s (which they should be). Anyone have an explaination?
    Last edited by Azmeos; 07-17-2003 at 11:38 AM.
    \0

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. SDLKey to ASCII without unicode support?
    By zacs7 in forum Game Programming
    Replies: 6
    Last Post: 10-07-2007, 03:03 AM
  2. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 05:49 PM
  3. About aes
    By gumit in forum C Programming
    Replies: 13
    Last Post: 10-24-2006, 03:42 PM
  4. byte is equal 8 bits???
    By Micko in forum C Programming
    Replies: 3
    Last Post: 10-15-2004, 10:12 AM
  5. error: identifier "byte" is undefined.
    By Hulag in forum C++ Programming
    Replies: 4
    Last Post: 12-10-2003, 05:46 PM