How can I get image bytes from hbitmap if I am given an HBITMAP pointer, and my application is console application. I tryed using GetDIBits which require such parameter as HDC, which I can't get.
EDIT: I load bitmap from file:
HBITMAP bm = 0;
BITMAP Bitmap;
bm = (HBITMAP)LoadImage (0, TEXT("C:\\img1.bmp"), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
I pass the HBITMAP to the function and expect to get another HBITMAP of processed image:
HBITMAP out1 = func(bm);
Where func is:
HBITMAP func(HBITMAP im);
And the problem is how to get image bytes from HBITMAP.
GetDIBits
but doesn't have a DC to pass to it (like the sample you linked to shows). – WebbyHBITMAP
without an accompanyingHDC
?" – Webby