我用DDRAW作过,
代码丢了,
怀念啊
代码丢了,
怀念啊
解决方案 »
- 继承CStatic,做动画类,创建两个实例,这两个实例有重叠。为何下面的有时也显示出来呢。
- 谁有ftp源码啊?发我一个。
- 请教大家,图像匹配的应用
- Spy++为什么不能捕获MSN即时消息窗口中的子窗口???
- 对话框的显示问题请教
- 两个线程互斥访问一个文件怎麽做?
- 非常邪门的问题:dc.SetBkMode(TRANSPARENT);语句编译通不过?错误信息为:error C2065: 'TRANSPARENT' : undeclared identifier
- 分割窗口之后, 如果让加载的CFromView(对话框)随着分割区的大小变化而变化(分割区由于容不下对话框而出现滚动条,不想要滚动条)
- 有关于CShockwaveFlash使用的问题?急!!!!
- 这样的安装盘怎么制作啊?
- 200高分!!!!VC,VB混合编程方案讨论,必给分
- 给100分!!!急!!!如何用VB生成标准的DLL,并在VC中用标准格式调用。
有一些道理,就算一样吧!那具体应该如何实现呢,描述一下就行了
我想知道个大概!多谢了哥们
{
// TODO: Add your specialized code here and/or call the base class
CScrollView::OnPrepareDC(pDC, pInfo);
CEMapDoc* pDoc = GetDocument();
CSize sizeDoc = pDoc->GetSize();
CPoint ptOrg;
CRect rectClient;
GetClientRect(&rectClient);
pDC->DPtoLP(&rectClient);
ptOrg.x = min(-sizeDoc.cx / 2,-rectClient.Size().cx/2);
ptOrg.y = max(sizeDoc.cy / 2,-rectClient.Size().cy/2);
// ptOrg is in logical coordinates
pDC->SetWindowOrg(ptOrg);
}
void CEMapThumbnailView::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo)
{
// TODO: Add your specialized code here and/or call the base class
CEMapDoc* pDoc = GetDocument();
CSize sizeDoc=pDoc->GetSize();
CRect rectClient;
GetClientRect(&rectClient);
pDoc->PixelToLongEngish(&rectClient);
CView::OnPrepareDC(pDC, pInfo);
pDC->SetMapMode(MM_ANISOTROPIC);
CSize sizeView;
LONGLONG x1y2,x2y1;
x1y2=Int32x32To64(sizeDoc.cx,rectClient.Width());
x2y1=Int32x32To64(sizeDoc.cy,rectClient.Height());
if(x1y2>x2y1){//image is too wide,stretch y
sizeView.cx=::MulDiv(sizeDoc.cy,rectClient.Width(),rectClient.Height());
sizeView.cy=sizeDoc.cy;
}
else{//image is too thin,stretch x
sizeView.cx=sizeDoc.cx;
sizeView.cy=::MulDiv(sizeDoc.cx,rectClient.Height(),rectClient.Width());
}
GetClientRect(&rectClient);
pDC->SetWindowExt(sizeView);
pDC->SetViewportExt(rectClient.Width(),-rectClient.Height());
CPoint ptOrg;
ptOrg.x = -sizeView.cx/2;
ptOrg.y = sizeView.cy/2;
// ptOrg is in logical coordinates
pDC->SetWindowOrg(ptOrg.x,ptOrg.y);}
void CEMapThumbnailView::OnDraw(CDC* pDC)
{
CEMapDoc* pDoc = GetDocument();
// TODO: add draw code here
CRect rectMap=pDoc->GetMapRect() ;
pDoc->m_dibMapCurrent.Draw(*pDC,&rectMap);
if(pDoc->m_pEMapView->GetSafeHwnd()){
CRect rectViewPort;
pDoc->m_pEMapView->GetViewPort(&rectViewPort);
CSize sizeTotal=pDoc->m_pEMapView->GetTotalSize();
//rectViewPort.OffsetRect(sizeTotal.cx/2,sizeTotal.cy/2);
m_RectTracker.m_rect.left=MulDiv(rectViewPort.left,rectMap.Width(),sizeTotal.cx);
m_RectTracker.m_rect.right=MulDiv(rectViewPort.right,rectMap.Width(),sizeTotal.cx);
m_RectTracker.m_rect.top=-MulDiv(rectViewPort.bottom,rectMap.Height(),sizeTotal.cy);
m_RectTracker.m_rect.bottom=-MulDiv(rectViewPort.top,rectMap.Height(),sizeTotal.cy);
pDC->LPtoDP(m_RectTracker.m_rect);
m_RectTracker.Draw(pDC);
}
}
void CEMapView::GetViewPort(LPRECT lpRect)
{
GetClientRect(lpRect);
ClientToDoc(lpRect);
}