1. C syntax in DIB image size calculation: ">>" and "~"

Vincent...

The symbol >> means shift bits to the right by the right argument number, in this case 3. This is a binary function, so in binary terms this is what happens... let's say your number is 256, or

100000000 in binary notation. Shifting the number to the right by 3 would result in 100000, or 32, or in human terms a division of the number by 2 to the 3rd, or 8, if you were shifting right by 4 you would effectively be dividing by 2 to the 4th, or 16.

The symbol ~ is the ones complement operator... this simply inverts all binary bits. in the case of 31 which is 00000000000000000000000000011111 in binary, the number becomes 11111111111111111111111111100000, or 4,294,967,246 in base 10.

The bottom line is this whole algoritm simply aligns the number on a DWORD, or 4 byte boundary. All of the results should be evenly divisible by 4.

Ex: ImageWidth = 101, Bitcount = 24

((((101 * 24) + 31) & ~31)>>3) =

( (2455 & ~31) >> 3) =

(2455 & 4,294,967,246) >> 3 =

2432 >> 3 =

304

304 is evenly divisible by 4, or DWORD aligned.

Rick

2. Cannot open search page after SP1 for XP installation

3. |||||"""" How do I lock a CDROM """"|||||

4. VISUAL BASIC OCX

5. WANTED """ NT 3.51 Training Videos """" WANTED

6. How to hide a directory?

7. "Reply" doesn't always indent with ">"

8. gemini d-16 scanner

9. param name="ActivateActiveXControls" value="-1">

10. Folders: "My ..." versus "<named> folders"

11. wmp copy to cd """ error """

12. FLIC ====>>> MPEG ... need "DISPLAY"

13. "New Message", "Send Page" & "Send a Link" from IE6