绘图
CStatic* p;
p = (CStatic*)GetDlgItem(IDC_STATIC);
CRect rcStatic;
p->GetClientRect(&rcStatic);
HDC hdc = ::GetDC(*p);
HPEN hPen;
hPen = CreatePen(PS_SOLID, 3, RGB(255, 0, 0));
SelectObject(hdc, hPen);
Rectangle(hdc, rcStatic.left, rcStatic.top, rcStatic.right, rcStatic.bottom);
插入图片
m_bmp.ModifyStyle(0, SS_BITMAP);
HBITMAP hBmp = LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_BITMAP1));
m_bmp.SetBitmap(hBmp);