设为首页 加入收藏

TOP

directdraw的多画面显示rgb(三)
2014-11-23 17:55:52 来源: 作者: 【 】 浏览:47
Tags:directdraw 画面 显示 rgb
SD_CAPS | DDSD_WIDTH | DDSD_HEIGHT;
ddsd.dwWidth = SCREEN_WIDTH;
ddsd.dwHeight = SCREEN_HEIGHT;
ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
//
SetTimer(1,1000,NULL);
return; //执行成功
}
int index=0;
void CshowpicDlg::OnTimer(UINT_PTR nIDEvent)
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
int tmp = 0;
for(int i=0;i<6;i++)
{
if(DD_OK!=(lpdd7->CreateSurface(&ddsd, &lpddsmypage[i], NULL)))
{
return ;
}
POINT p;
p.x = 0; p.y = 0;
m_screen.ClientToScreen(&p);
tmp = (i+index)%6;
// m_screen.GetClientRect(&rcRectDest);
if(i==5)
{rcRectDest.left = 0; rcRectDest.top=0; rcRectDest.right = 640; rcRectDest.bottom = 480;}
else if(i==4)
{rcRectDest.left = 640; rcRectDest.top=0; rcRectDest.right = 960; rcRectDest.bottom = 240;}
else if(i==3)
{rcRectDest.left = 640; rcRectDest.top=240; rcRectDest.right = 960; rcRectDest.bottom = 480;}
else if(i==2)
{rcRectDest.left = 640; rcRectDest.top=480; rcRectDest.right = 960; rcRectDest.bottom = 720;}
else if(i==1)
{rcRectDest.left = 320; rcRectDest.top=480; rcRectDest.right = 640; rcRectDest.bottom = 720;}
else if(i==0)
{rcRectDest.left = 0; rcRectDest.top=480; rcRectDest.right = 320; rcRectDest.bottom = 720;}
OffsetRect(&rcRectDest, p.x, p.y);
SetRect(&rcRectSrc, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
/////////////////////////////////////////////////////////////
if(DD_OK != lpddsmypage[i]->Lock(NULL,&ddsd,DDLOCK_WAIT|DDLOCK_SURFACEMEMORYPTR,NULL))
{
return ;
}
DWORD *bmp_buffer = (DWORD *)ddsd.lpSurface;
memcpy(bmp_buffer,buf[tmp],SCREEN_WIDTH*SCREEN_HEIGHT*4);
if(DD_OK != lpddsmypage[i]->Unlock(NULL))
{
return ;
}
if(DD_OK != lpddsprimary->Blt( &rcRectDest, lpddsmypage[i], &rcRectSrc, DDBLT_WAIT, NULL))
{
return ;
}
if(lpddsmypage)
{
lpddsmypage[i]->Release();
lpddsmypage[i]=NULL;
}
}
index++;
CDialog::OnTimer(nIDEvent);
}v
首页 上一页 1 2 3 下一页 尾页 3/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇CWnd *和HWnd转换 下一篇directdraw显示rgb555

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: