我创建了一个矩形区域用于作图,我想在窗口放大或缩小时这个矩形区域的图素不变,我现在的问题是放大窗口时矩形区域内的笔画变粗,而且之前矩形区域外的作图(就是鼠标划过的笔画)也出现了(之前是不会显示的,但放大窗口就会出现),请教大家我该怎么弄?谢谢!
解决方案 »
- vc对话框怎么和CScroolBar关联在一起
- 救命,哪位大是给我解决这个关于对话框的问题
- CDialog在DoModal()后弹出对话框,可是却接受不到消息,是为什么呢?
- DES加密算法在myicq中应用的困惑(菜鸟级的问题)
- 关于#pragma code_seg()的疑问
- 数组的文本输出问题,将一个数组里的数据(double)输出到一个文本中,应该怎么办?(答了都给分)最好是高效率的代码!
- 一个很简单的问题。
- 系统操作问题
- 困扰了我很久的问题,关于整型和CString类型的问题能够相互转化的问题
- [原创&交流]OpenCV学习笔记(一)
- 如何让图像在窗口指定区域显示?
- 怎么读取内存中数据并显示出来
首先在ondraw里:
void CScribbleView::OnDraw(CDC* pDC)
{
CScribbleDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc); // The view delegates the drawing of individual strokes to
// CStroke::DrawStroke().
CTypedPtrList<CObList,CStroke*>& strokeList = pDoc->m_strokeList;
POSITION pos = strokeList.GetHeadPosition();
while (pos != NULL)
{
CStroke* pStroke = strokeList.GetNext(pos);
pStroke->DrawStroke(pDC);
}
}
然后就是在void CScribbleView::OnMouseMove(UINT, CPoint point)
{
// Mouse movement is interesting in the Scribble application
// only if the user is currently drawing a new stroke by dragging
// the captured mouse. if (GetCapture() != this)
return; // If this window (view) didn't capture the mouse,
// then the user isn't drawing in this window.
CRgn Rgn;
Rgn.CreateRectRgn(100,100,400,400);
CDC *pDC=GetDC();
pDC->SelectClipRgn(&Rgn);
m_pStrokeCur->m_pointArray.Add(point);
pDC->MoveTo(m_ptPrev);
pDC->LineTo(point);
m_ptPrev = point;
return;
}
我是想在窗口放大的时候这个作图的矩形区域不放大,比如原来在小窗口里面100x100的矩形区域,放大窗口后那个矩形区域还是100x100.