HBITMAP to cv::Mat

asked 2019-08-02 06:38:24 -0500

mirhanu gravatar image

I have a HBITMAP variable in my hand which I read from a BMP file. I want to convert it to cv::Mat and then sav it as a .jpg file. I searched for the solution. But, none of my findings seemed to work. Would you show how to that in C++?

Ps: Reading BMP file directly with CV:Mat doesn't count. I am supposed to read it to HBITMAP.

Thanks.

edit retag flag offensive close merge delete

Comments

you need a computer vision library to save a jpg ?

berak gravatar imageberak ( 2019-08-02 06:53:59 -0500 )edit

No, I do that with opencv. I need to convert HBITMAP to cv::Mat

mirhanu gravatar imagemirhanu ( 2019-08-02 07:24:56 -0500 )edit

how would anyone know from your question, what a hbitmap is, and what's inside ?

berak gravatar imageberak ( 2019-08-02 08:08:09 -0500 )edit

if you don't know what HBITMAP is, then this question is irrelevant to you.

mirhanu gravatar imagemirhanu ( 2019-08-02 08:54:16 -0500 )edit

see this and/or this to find related example code

sturkmen gravatar imagesturkmen ( 2019-08-02 09:51:29 -0500 )edit