本文整理汇总了C++中CDevice::Blit方法的典型用法代码示例。如果您正苦于以下问题:C++ CDevice::Blit方法的具体用法?C++ CDevice::Blit怎么用?C++ CDevice::Blit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDevice
的用法示例。
在下文中一共展示了CDevice::Blit方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WndProc
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
PAINTSTRUCT ps;
HDC hdc;
static HANDLE hDrawThread = NULL;
static HANDLE hAppThread = NULL;
switch (message)
{
case WM_CHAR:
if (wParam == VK_ESCAPE)
PostQuitMessage(0);
break;
case WM_KEYDOWN:
g_dev.OnKeyDown( (int)wParam );
break;
case WM_KEYUP:
g_dev.OnKeyUp( (int)wParam );
break;
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
break;
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
g_dev.Blit( hdc );
EndPaint(hWnd, &ps);
break;
case WM_CREATE:
{
g_running = TRUE;
hDrawThread = CreateThread( NULL, NULL, &ThreadProcDraw, NULL, NULL, NULL );
hAppThread = CreateThread( NULL, NULL, &ThreadProcApp, NULL, NULL, NULL );
break;
}
case WM_CLOSE:
g_running = FALSE;
Sleep(10);
DestroyWindow(hWnd);
break;
case WM_DESTROY:
TerminateThread( hDrawThread, 1 );
TerminateThread( hAppThread, 1 );
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}
示例2: ThreadProcDraw
DWORD WINAPI ThreadProcDraw(HANDLE handle)
{
while ( !g_hwnd )
Sleep( 10 );
ShowWindow( g_hwnd, SW_SHOW );
HDC hdc = GetDC( g_hwnd );
while (g_running)
{
g_dev.Blit( hdc );
Sleep( 10 );
}
return 0;
}
示例3: WndProc
//
// FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)
//
// PURPOSE: Processes messages for the main window.
//
// WM_COMMAND - process the application menu
// WM_PAINT - Paint the main window
// WM_DESTROY - post a quit message and return
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
PAINTSTRUCT ps;
HDC hdc;
switch (message)
{
case WM_CHAR:
if (wParam == VK_ESCAPE)
PostQuitMessage(0);
break;
case WM_KEYDOWN:
dev.OnKey( (int)wParam );
break;
case WM_TIMER:
InvalidateRect(hWnd, NULL, FALSE);
break;
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
break;
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
dev.Blit( hdc );
// TODO: Add any drawing code here...
EndPaint(hWnd, &ps);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}