Convert HBITMAP to cv::Mat

前端 未结 3 1555
[愿得一人]
[愿得一人] 2021-01-24 10:56

I can\'t seem to figure out how to do this, I have searched on google and found two code examples, one from a github screen capture library and another on a posting group and ne

3条回答
  •  离开以前
    2021-01-24 11:30

    I don't know what it is, but the minute I ask a question, I get obssesed with finding the answer. Anyway, part of this issue is actually solved by the answer to this question:

    OpenCV 2.0 C++ API using imshow: returns unhandled exception and "bad-flag"

    In Visual C++:

    go to Project->Properties (or Alt-F7) Configuration Properties->Linker->Input->Additional Dependencies

    replace the usual " cv210.lib cxcore210.lib highgui210.lib" by " cv210d.lib cxcore210d.lib highgui210d.lib" - which are the debugging libraries.

    highgui still shows grey and doesn't work, but reading from the HBITMAP using the above method now works. and I don't really need highgui, it was just for testing anyway.

提交回复
热议问题