读书人

有关HDC的!

发布时间: 2012-03-03 15:33:03 作者: rapoo

有关HDC的求助!!
有关HDC的求助!!


memcpy(cbInfo.pBuffer, pBuffer, lBufferSize); 中已经获取 (pBuffer, lBufferSize)

但利用StillCap中的下面语句进行绘图时却提示 "error C2660: “CWnd::GetDC” : 函数不接受 1 个参数
"等等的错误,怎么解决???, 在线等
HWND hwndStill = NULL;
pOwner-> GetDlgItem( IDC_STILL, &hwndStill );

RECT rc;
::GetWindowRect( hwndStill, &rc );
long lStillWidth = rc.right - rc.left;
long lStillHeight = rc.bottom - rc.top;

HDC hdcStill = GetDC( hwndStill );
PAINTSTRUCT ps;
BeginPaint(hwndStill, &ps);

SetStretchBltMode(hdcStill, COLORONCOLOR);
StretchDIBits(
hdcStill, 0, 0,
lStillWidth, lStillHeight,
0, 0, lWidth, lHeight,
pBuffer,
(BITMAPINFO*) pbih,
DIB_RGB_COLORS,
SRCCOPY );

EndPaint(hwndStill, &ps);
ReleaseDC( hwndStill, hdcStill );


[解决办法]
HDC hdcStill = GetDC( hwndStill );
改成


HDC hdcStill = ::GetDC( hwndStill );

请使用 ::GetDC试试。应该是Win32 API的GetDC函数和CWnd类的GetDC成员函数重名引起的,编译器默认使用当前名字空间内的成员函数。

读书人网 >多媒体

热点推荐