user3720193
user3720193

Reputation: 1

How to retrieve the HBITMAP from a Picture Control (MFC c++)?

I would like to know how to get the HBITMAP from a Picture Control (MFC c++). I tried this code but it didn't work:

HBITMAP hBitmap1 = 
    (HBITMAP)SendMessage(GetDlgItem(m_hWnd,IDC_VIEW),STM_GETIMAGE,
    (WPARAM)IMAGE_BITMAP,(LPARAM) 0);
HBITMAP hBitmap2 = (HBITMAP)CopyImage (hBitmap1, 
                    IMAGE_BITMAP, 0, 0, LR_COPYRETURNORG);

Thank you

Upvotes: -1

Views: 789

Answers (1)

ScottMcP-MVP
ScottMcP-MVP

Reputation: 10425

Call GetBitmap on the CStatic control.

Upvotes: 0

Related Questions