VC程序启动画面
2008-12-31 01:50
176 查看
HBITMAP hBmp; //要显示的位图
hBmp = LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_BITMAPgtlogo));
HDC hScreenDC = CreateDC("DISPLAY", NULL, NULL, NULL); //屏幕DC
HDC hMemDC = CreateCompatibleDC(hScreenDC); //内存DC
int iScreenWidth = ::GetDeviceCaps(hScreenDC, HORZRES); //屏幕的宽
int iScreenHeight = ::GetDeviceCaps(hScreenDC, VERTRES); //屏幕的高
BITMAP bmpInfo;
GetObject(hBmp, sizeof(BITMAP), &bmpInfo);
int iBmpWidth = bmpInfo.bmWidth; //位图宽
int iBmpHeight = bmpInfo.bmHeight; //位图高
int x = (iScreenWidth - iBmpWidth) / 2; //显示的x位置
int y = (iScreenHeight - iBmpHeight) / 2; //显示的y位置
SelectObject(hMemDC, hBmp);
::BitBlt(hScreenDC, x, y, iScreenWidth, iScreenHeight, hMemDC, 0, 0, SRCCOPY);
Sleep(2000); //查看效果
//释放资源
DeleteDC(hMemDC);
DeleteDC(hScreenDC);
DeleteObject(hBmp);
hBmp = LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_BITMAPgtlogo));
HDC hScreenDC = CreateDC("DISPLAY", NULL, NULL, NULL); //屏幕DC
HDC hMemDC = CreateCompatibleDC(hScreenDC); //内存DC
int iScreenWidth = ::GetDeviceCaps(hScreenDC, HORZRES); //屏幕的宽
int iScreenHeight = ::GetDeviceCaps(hScreenDC, VERTRES); //屏幕的高
BITMAP bmpInfo;
GetObject(hBmp, sizeof(BITMAP), &bmpInfo);
int iBmpWidth = bmpInfo.bmWidth; //位图宽
int iBmpHeight = bmpInfo.bmHeight; //位图高
int x = (iScreenWidth - iBmpWidth) / 2; //显示的x位置
int y = (iScreenHeight - iBmpHeight) / 2; //显示的y位置
SelectObject(hMemDC, hBmp);
::BitBlt(hScreenDC, x, y, iScreenWidth, iScreenHeight, hMemDC, 0, 0, SRCCOPY);
Sleep(2000); //查看效果
//释放资源
DeleteDC(hMemDC);
DeleteDC(hScreenDC);
DeleteObject(hBmp);
相关文章推荐
- 【VC编程技巧】窗体☞3.5对单文档或者多文档程序制作启动画面
- VC++程序启动画面会先看到MainFrame先闪一下再消失的问题解法
- 四种程序启动画面的制作方法(VC)
- VC四种程序启动画面的制作方法
- 四种程序启动画面的制作方法(VC)
- 四种程序启动画面的制作方法(VC)
- 【VC编程技巧】窗口☞3.5对单文档或者多文档程序制作启动画面
- 用VC创建程序启动画面
- 四种程序启动画面的制作方法(VC)
- 四种程序启动画面的制作方法(VC)
- vc 程序启动画面
- 四种程序启动画面的制作方法(VC)
- [开发] 四种程序启动画面的制作方法(VC)
- 四种程序启动画面的制作方法(VC)
- VC四种程序启动画面的制作方法
- vc 程序启动画面
- VC中四种程序启动画面的制作方法
- 四种程序启动画面的制作方法(VC)(转)
- 四种程序启动画面的制作方法(VC)
- 四种程序启动画面的制作方法(VC)