bi.biSizeImage = ((((bi.biWidth * bi.biBitCount) + 31) & ~31) / 8) 
* bi.biHeight;
能解释下吗?
另外还有一个问题就是以下语句能起到什么作用,屏蔽系统热键?可以屏蔽鼠标键盘的消息吗?
SystemParametersInfo(SPI_SCREENSAVERRUNNING, 1, NULL,0);

解决方案 »

  1.   

    DWORD对齐就是要让一个位图的一行数据存储时大小必须是4字节的倍数!不足4的用0补齐!
    上面那个语句的意思就是要让一行的数据必须是4的部数的作用!
      

  2.   

    the Data Alignment options let you choose how the compiler aligns data in stored memory. Word, Dword, and quadword alignment force  items to be aligned on memory addresses that are a multiple of the type chosen. Extra bytes are inserted in structures to ensure that members align correctly.Default = Double Word (32-bit)Byte aligns to 8-bit boundaries.
    Word aligns to 16-bit boundaries.
    Double Word aligns to 32-bit boundaries. Data with type sizes of less than 4 bytes are aligned on their type size.
    Quad Word aligns to 64-bit boundaries. Data with type sizes of less than 8 bytes are aligned on their type size.
      

  3.   

    DWORD对齐是指DWORD存储的开始和结束都位于 被 4整除的位置,比如说 
    从 0004 开始 到 0007。如果数据不够,达不到 0007,那么就需要补充无用的数据,
    使得结束位置达到 0007。DWORD对齐之后系统操作位图速度会比较快。============================================================================
    提问题时标题要简明扼要地说明问题内容,切忌使用"急","求救"之类不能说明问题的标题
    http://alphasun.betajin.com/   遇到问题可以给我发消息,给我发信息时请附带原帖地址
    DocWizard C++程序文档自动生成工具 | Wave OpenGL | HttpProxy | AjaxParser词法分析