本文整理汇总了C++中CPaintManagerUI::GetPaintDC方法的典型用法代码示例。如果您正苦于以下问题:C++ CPaintManagerUI::GetPaintDC方法的具体用法?C++ CPaintManagerUI::GetPaintDC怎么用?C++ CPaintManagerUI::GetPaintDC使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPaintManagerUI
的用法示例。
在下文中一共展示了CPaintManagerUI::GetPaintDC方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: VwSnapShot
// HANDLE VwSnapShot(VApiHandle hWnd)
SQInteger VwSnapShot(HSQUIRRELVM v)
{
SQInteger nargs = sq_gettop(v);
SQInteger nWnd = 0;
HWND hWnd = NULL;
CUIImage* pImg = NULL;
CScriptMgr* pMgr = NULL;
CPaintManagerUI* pPM = NULL;
BOOL bIsAlphaWin = NULL;
VApiHandle hRet = NULL;
CUIRect rt;
if (!v || 1 + 1 != nargs) {goto _Exit_;}
if (OT_INTEGER != sq_gettype(v, 2)) {goto _Exit_;}
sq_getinteger(v, 2, &nWnd);
if (-1 == nWnd) {
pMgr = (CScriptMgr*)sq_getforeignptr(v);
if (!pMgr) {goto _Exit_;}
pPM = pMgr->GetManager();
if (!pPM) {goto _Exit_;}
hWnd = pPM->GetPaintWindow();
} else {
hWnd = QiHwHandleToWin(nWnd)->pWinObj->GetHWND();
}
::GetWindowRect(hWnd, &rt);
bIsAlphaWin = pPM->IsAlphaWin();
pImg = new CUIImage();
pImg->Create(pPM->GetPaintDC(), rt.GetWidth(), rt.GetHeight(), 0, TRUE);
::PrintWindow(hWnd, pImg->GetDC(), 0);
::SendMessage(hWnd, WM_PRINT, (WPARAM)pImg->GetDC(), PRF_NONCLIENT | PRF_CLIENT | PRF_ERASEBKGND | PRF_CHILDREN);
hRet = QiHwObjToHandle(pImg);
_Exit_:
sq_pushinteger(v, hRet);
return 1;
}