首页 > 代码库 > ActiveX显示图片
ActiveX显示图片
直接看代码:
// IPlayCtlpublic: HRESULT OnDraw(ATL_DRAWINFO& di) { RECT& rc = *(RECT*)di.prcBounds; /* Rectangle(di.hdcDraw, rc.left, rc.top, rc.right, rc.bottom); SetTextAlign(di.hdcDraw, TA_CENTER|TA_BASELINE); LPCTSTR pszText = _T("ATL 3.0 : PlayCtl"); TextOut(di.hdcDraw, (rc.left + rc.right) / 2, (rc.top + rc.bottom) / 2, pszText, lstrlen(pszText)); */ HDC hdc=di.hdcDraw; m_hBitmap= //(HBITMAP)LoadBitmap (NULL, "D:\\test.bmp") ; (HBITMAP)::LoadImage(NULL,"D:\\test.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE); HDC hdcMem=CreateCompatibleDC(hdc); SelectObject(hdcMem, m_hBitmap); BitBlt(hdc,0,0,IMAGE_WIDTH,IMAGE_HEIGHT,hdcMem,0,0,SRCCOPY); DeleteDC(hdcMem); return S_OK; } OLE_COLOR m_clrFillColor; HBITMAP m_hBitmap;};
参考:
1,ATL窗口添加背景图片
http://blog.163.com/l1_jun/blog/static/14386388201092521520392/
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。