[MS Smartphone]Double Buffering Using Native C Code
来源:互联网 发布:plc编程兼职 编辑:程序博客网 时间:2024/05/07 12:25
void CreateGrphicMenuWin()
{
WNDCLASS wc;
RECT rect;
ZeroMemory(&wc, sizeof(wc));
...
wc.lpfnWndProc = (WNDPROC)MenuWinProc;
...
//RegisterClass(&wc)
//CreateWindow
//ShowWindow
//UpdateWindow
}
BOOL CALLBACK MenuWinProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
LRESULT lResult = 0;
PAINTSTRUCT ps;
switch(msg)
{
...
case WM_PAINT:
{
HDC hDC = BeginPaint(hwnd,&ps);
DrawGraphicMenuBar(hwnd,hDC);
EndPaint (hwnd, &ps);
}
return 0;
...
}
return (DefWindowProc(hwnd, msg, wParam, lParam));
}
void DrawGraphicMenuBar(HWND hwnd, HDC hDC)
{
HDC hMemDC = CreateCompatibleDC(hDC);
HDC hDrawDC = CreateCompatibleDC(hDC);
HBITMAP hBitmap, hOldbmp;
HBITMAP hBgTitle, hPlay, hStop;
HBITMAP hOldBgTitle, hOldPlay, hOldStop;
hBitmap = CreateCompatibleBitmap(hDC, PHONEWIDTH, MENUHEIGHT);
hOldbmp = (HBITMAP)SelectObject(hMemDC, hBitmap);
hBgTitle = LoadBitmap(context->hInst, MAKEINTRESOURCE(IDB_SBGTITLE));
hOldBgTitle = (HBITMAP) SelectObject(hDrawDC, hBgTitle);
BitBlt(hMemDC, 0, 0, PHONEWIDTH, MENUHEIGHT, hDrawDC, 0, 0, SRCCOPY);
SelectObject(hDrawDC, hOldBgTitle);
DeleteObject(hBgTitle);
hPlay = LoadBitmap(context->hInst, MAKEINTRESOURCE(IDB_SPLAY));
hOldPlay = (HBITMAP) SelectObject(hDrawDC, hPlay);
BitBlt(hMemDC, LEFTSPACE, TOPSPACE, PLAYPAUSEWIDTH, ICONHEIGHT, hDrawDC, 0, 0, SRCCOPY);
SelectObject(hDrawDC, hOldPlay);
DeleteObject(hPlay);
hStop = LoadBitmap(context->hInst, MAKEINTRESOURCE(IDB_SSTOP));
hOldStop = (HBITMAP) SelectObject(hDrawDC, hStop);
BitBlt(hMemDC, PLAYPAUSEWIDTH+LEFTSPACE, TOPSPACE, STOPWIDTH, ICONHEIGHT, hDrawDC, 0, 0, SRCCOPY);
SelectObject(hDrawDC, hOldStop);
DeleteObject(hStop);
BitBlt(hDC, 0, 0, PHONEWIDTH, MENUHEIGHT, hMemDC, 0, 0, SRCCOPY);////
SelectObject(hMemDC, hOldbmp);
DeleteObject(hBitmap);
DeleteDC(hMemDC);
DeleteDC(hDrawDC);
}
- [MS Smartphone]Double Buffering Using Native C Code
- [MS Smartphone]Make phone call using native c code
- Double Buffering
- [MS Smartphone] Connection Manager Sample Code
- 双缓冲 Double Buffering
- C#中的double buffering
- Double Buffering Windows Forms
- 什么是double buffering和mutiple buffering
- MFC 双缓冲(double buffering)
- 双缓冲技术:Double Buffering
- What are Double Buffering, vsync and Triple Buffering?
- [MS Smartphone]Memory leak check
- 开发MS Smartphone 游戏(转贴)
- QT-双缓冲技术(Double Buffering)-2
- 双缓冲技术(Double Buffering)-3 .
- 双缓冲技术(Double Buffering)-4
- 5.4 双缓冲技术(Double Buffering)-5
- WindML双缓冲(Double Buffering)总结
- 在VC中使用FileSystemObject
- 10.15 23.55 周六的最后五分钟
- 重装机器的回想。
- C# 3.0(C# Orcas——魔鬼)
- 网络经济与和谐社会发展方向
- [MS Smartphone]Double Buffering Using Native C Code
- 猪
- 我在Spring中解决中文乱码的方法
- C++学习笔记(6)
- 复制DBGrid当前行到剪切板
- 刚刚完成的HuffmanCode问题
- ASP.NET中 WebControls 命名规则
- 一生的简历
- ADO.NET命名规则