一彩色32位的rgb缓冲用gdi的方式显示出来,怎么才能显示成黑白的???

解决方案 »

  1.   

    你仔细理解以下MSDN中这一段话
    Note: When a memory device context is created, it initially has a 1-by-1 monochrome bitmap selected into it. If this memory device context is used in CreateCompatibleBitmap, the bitmap that is created is a monochrome bitmap. 
    Because memory device contexts allow both color and monochrome bitmaps, the format of the bitmap returned by the CreateCompatibleBitmap function differs when the specified device context is a memory device context.
      

  2.   

    创建一个Mask位图,选入DC,BitBlt即可
      

  3.   

    那段英文的意思好像是CreateCompatibleBitmap的参数用内存dc时创建的就是单色位图,那么吧你得位图BitBlt上来就行了。
    有这种作用,没有注意过。偶也要试试效果怎么样,学习了。