在输出文本时想只重会当前修改的内容,但是没想到其他行的文本都不见了,只剩下当前行,怎么回事??
解决方案 »
- 不知谁有处理基于S-57(数字化海道测量数据传输规范)格式的数据处理类!!
- 请问 怎样把一个目录下的所有扩展名为.rmvb的文件改为扩展名为.avi?
- 如何获得一幅位图的BITMAPINFO数据呢?(100)
- 帮助--一个基本的结构体输入出问题
- 请问怎样将现有的图片通过资源视图添加到CToolBar上去啊?
- 哪里有免费的BCGControlBar Pro 7.4 下载?
- 有谁知道:我的程序在debug版没有异常,当Release出来后发生异常。不知道怎么调试,哪位老兄指点以下.(100相送)
- dll中能否使用ado啊?我怎么在stdafx.h加入如下语句后编译,很多错误呢?在MFC的exe工程中没有问题.
- 简单问题:改善此段程序,不用goto语句
- 请教下面错误
- 问题?
- 请问Visual SourceSafe可以在互联网上工作吗?
if (bRedrawWhole == TRUE) { //we need to redraw the whole view
//construct text rect for drawing based on the scroll position
rectText = rectClient;
rectText.right += ScrolledPos.x;
rectText.top += ScrolledPos.y;
rectText.bottom += ScrolledPos.y;
for (i = nStartLine; i <= nEndLine; i++) {
sli = pLines->GetAt(i);
sTmp.Format("%s" , sli.m_pcLine);
nLineHeight = pDC->DrawText(sTmp , -1 , &rectText, DT_TOP | DT_NOPREFIX | DT_SINGLELINE | DT_EXPANDTABS);
rectText.top += nLineHeight;
}
} else { // we need only to redraw the current 2 lines
//construct text rect for drawing based on the scroll position
rectText = rectClient;
rectText.right += ScrolledPos.x;
rectText.top += ScrolledPos.y + (nCurrentLine - nStartLine) * nLineHeight;
rectText.bottom += ScrolledPos.y + (nCurrentLine - nStartLine) * nLineHeight;
for (i = 0; i <= 1; i++) {
sli = pLines->GetAt(nCurrentLine + i);
sTmp.Format("%s" , sli.m_pcLine);
nLineHeight = pDC->DrawText(sTmp , -1 , &rectText, DT_TOP | DT_NOPREFIX | DT_SINGLELINE | DT_EXPANDTABS);
//pDC->TabbedTextOut(rectText.left, rectClient.top, sTmp, 0, NULL, 0);
rectText.top += nLineHeight;
}
bRedrawWhole = TRUE;
}
sli = pLines->GetAt(i);
sTmp.Format("%s" , sli.m_pcLine);
nLineHeight = pDC->DrawText(sTmp , -1 , &rectText, DT_TOP | DT_NOPREFIX | DT_SINGLELINE | DT_EXPANDTABS);
rectText.top += nLineHeight;
}——是不是在rectText.top += nLineHeight;这句后面少了
rectText.bottom += nLineHeight;我觉得应该是:
for (i = nStartLine; i <= nEndLine; i++) {
sli = pLines->GetAt(i);
sTmp.Format("%s" , sli.m_pcLine);
nLineHeight = pDC->DrawText(sTmp , -1 , &rectText, DT_TOP | DT_NOPREFIX | DT_SINGLELINE | DT_EXPANDTABS);
rectText.top += nLineHeight;
rectText.bottom += nLineHeight;
}
不用,实际上rectText只定义了顶部坐标就可以了。其实我主要是想解决连续输入是的view的闪烁问题,本来想先在内存设备里画好,然后在输出倒屏幕设备,发现这样闪烁问题更严重,所以想能否只重写一行或两行。