曾经在OnDraw() 中用pdc->textout() 显示文字;
在leftbutoondown()中调用 ondraw() ,可以正常显示
现在 不直接调要 改用 InvalidateRect(rect,false); 调用 ,图片显示都是正确的,为什么pdc->textout() ,
却不能正常显示
.
在leftbutoondown()中调用 ondraw() ,可以正常显示
现在 不直接调要 改用 InvalidateRect(rect,false); 调用 ,图片显示都是正确的,为什么pdc->textout() ,
却不能正常显示
.
解决方案 »
- MFC 静态加载位图 运行时为什么显示不了
- 急!请帮忙!谢谢vc写的socket传文件,Debug版本提示"The operation timed out" Rel版本提示"指令引用的内存不能为read"
- 关于属性表单??
- 模拟 MFC 的 CWnd 类的封装,出错的原因都是参数个数不匹配,而我调用的又不是 API 函数,而是类的成员函数,不知道为什么会不匹配.
- 编程实现ping命令,如何得到time值?(即要得到服务器的返回时间)
- 请问在一个程序的主线程中工作线程中怎么样设置线程的个数
- 菜鸟问题:如何知道一个bitmap的尺寸.
- .用CoInitialize(NULL)初始化com库,和使用AfxOleInit()初始化com库有什么不一样??
- DLL资源调用
- 请问SHELLEXECUTE执行成功后返回的值是什么?
- MFC“复制”怎么弄,帮帮我啊
- vc dll动态与静态加载问题
HWND hWnd, // handle to window
CONST RECT* lpRect, // rectangle coordinates
BOOL bErase // erase state
);
Parameters
hWnd
[in] Handle to the window whose update region has changed. If this parameter is NULL, the system invalidates and redraws all windows, and sends the WM_ERASEBKGND and WM_NCPAINT messages to the window procedure before the function returns.
lpRect
[in] Pointer to a RECT structure that contains the client coordinates of the rectangle to be added to the update region. If this parameter is NULL, the entire client area is added to the update region.
bErase
[in] Specifies whether the background within the update region is to be erased when the update region is processed. If this parameter is TRUE, the background is erased when the BeginPaint function is called. If this parameter is FALSE, the background remains unchanged.
-->
InvalidateRect(rect,TRUE);
在OnDraw中,有两点要求:
1. 不要用GetWindowDC要用CPaintDC,他们的过程和用途略有不同2. CPaintDC dc(this); //这一行必须在_parent::OnPaint()的前面,或去掉_parent::OnPaint()你dc.TextOut看看结果
好像没有 , 我并没有 这一行代码 _parent::OnPaint()