解决方案 »
- 跪求仿Windows画图程序源码或实现方案!!!
- VC异常处理之后,程序回到哪里?
- 一个几十万行的程序,里面类的关系很复杂,那种工具可以快速的生成里面的类关系图?
- 画笔CPen 单位的问题
- VC2005 静态编译问题(MD,MT)(高手请进)
- 调试程序出现了LNK2019的错误,应该如何解决?
- 请问高手,如何去掉控件的3D属性啊~
- 我想调用一个程序,最大化启动,ShellExecute(this->m_pMainWnd->m_hWnd, "open", szJarFile, NULL, NULL,SW_MAXIMIZE );可是还是最小化启
- 基础问题在线等待:怎么样获得字符的ASCII码,我用ASC("A"),为什么不行?
- 那儿有直接用API(非MFC)对ACCESS数据库操作的例子?
- GDI+的DrawString函数为什么写入的字还是透明的?
- VS2008 hash_compare编译出错
void CLEESView::ListenFirePicShowThread()
{
CLEESDoc *pdoc = GetDocument(); //CLEESDoc *pdoc = GetDocument(); std::vector<FlatDeiveInfo*>::iterator iter;
//TCHAR Path[200];
//memset(Path,0,200);
//CString strPath; ////::GetCurrentDirectory(strPath);
//::GetModuleFileName(NULL,Path,sizeof(Path));
//strPath = Path;
//strPath.ReleaseBuffer();
//int nPos;
//nPos=strPath.ReverseFind(_T('\\'));
//strPath =strPath.Left (nPos); //Graphics buffer(pView->m_hWnd); if (pdoc->FlatDevice.size() <= 0)
{
return ;
//return;
}
CBmpProc pic; pic.LoadFromResourceID(IDB_BITMAP1,NULL); //EnterCriticalSection(&g_cs); for (iter = pdoc->FlatDevice.begin() ; iter != pdoc->FlatDevice.end(); ++iter)
{
if (pdoc->LampsJudge((*iter)->DeviceTypeNum) == true)
{
//如果是故障则不进行闪动提示
//if ((*iter)->State == NORMAL)
//{
// continue;
//}
//如果是导光流不提示闪烁
if ((*iter)->GuideFlowGroup > 0)
{
continue;
} CString strDevicePath;
//获取当前平面坐标。把当前的屏幕坐标转换成逻辑坐标。因为存在,平面移动
//对比当前的屏幕坐标和逻辑坐标。如果逻辑坐标在当前屏幕显示区域内。则绘图。否则不绘图
//绘图坐标把当前的设备坐标在转换成当前屏幕坐标进行绘图
RECT rect;
GetClientRect(&rect);
//GetClientRect(&rect);
CPoint point;
CPoint point2;
CPoint DevicePoint;
DevicePoint.x = (*iter)->X;
DevicePoint.y = (*iter)->Y; point.x = rect.left;
point.y = rect.top;
point2.x = rect.right;
point2.y =rect.bottom; CClientDC dc(this);
OnPrepareDC(&dc); //CClientDC dc(this);
//OnPrepareDC(&dc); dc.DPtoLP(&point);
dc.DPtoLP(&point2);
dc.LPtoDP(&DevicePoint); int x =(*iter)->X;
int y=(*iter)->Y; CDC *pDc = GetDC();
//CDC *pDc = GetDC();
if (x > point.x && x< point2.x && y > point.y && y < point2.y)
{
CRect srcRect,dstRect;
//srcRect.IsRectNull();
srcRect.SetRectEmpty();
dstRect.SetRectEmpty();
if ((*iter)->State == NORMAL)
{
//continue;
//strDevicePath = FindPicName((*iter)->NormalDir,iter);
srcRect =FireShowPic(pDc,(*iter)->DeviceTypeNum,(*iter)->Angle,(*iter)->NormalDir);
}
if ((*iter)->State == URGENT)
{
if ((*iter)->Direction != 0)
{
//strDevicePath = FindPicName((*iter)->Direction,iter);
srcRect =FireShowPic(pDc,(*iter)->DeviceTypeNum,(*iter)->Angle,(*iter)->Direction);
}
else
{
//strDevicePath = FindPicName((*iter)->UrgentDir,iter);
srcRect =FireShowPic(pDc,(*iter)->DeviceTypeNum,(*iter)->Angle,(*iter)->UrgentDir); } } if (srcRect.IsRectEmpty())
{
continue;
} //srcRect =FireShowPic(pDc,(*iter)->DeviceTypeNum,(*iter)->Angle,(*iter)->Direction);
dstRect = DrawPicPonit((*iter)->DeviceTypeNum,(*iter)->Angle); //srcRect =FireShowPic(pDc,(*iter)->DeviceTypeNum,(*iter)->Angle,(*iter)->Direction);
//dstRect = DrawPicPonit((*iter)->DeviceTypeNum,(*iter)->Angle); dstRect.top = DevicePoint.y + dstRect.top;
dstRect.bottom = DevicePoint.y+dstRect.bottom;
dstRect.left = DevicePoint.x+ dstRect.left ;
dstRect.right = DevicePoint.x+ dstRect.right; CBmpProc *pBmp = (CBmpProc*)new(CBmpProc);
pBmp->LoadFromObject(pic,&srcRect);
if (pDc != NULL)
{
pBmp->Draw(*pDc,&dstRect);
ReleaseDC(pDc);
}
delete (CBmpProc*)pBmp;
}
} }
//LeaveCriticalSection(&g_cs);
Invalidate(false);
return ;
这句好像就崩了。晕了!!!