读书人

局部刷新的有关问题

发布时间: 2012-03-01 10:25:46 作者: rapoo

局部刷新的问题
比如在Image 中如何只update 一部分, 手头没有资料和帮助, 朋友们告诉下, 位置很好取,只是刷新的问题

[解决办法]
直接把新内容复制上去不就结了
Image1.Canvas.CopyRect
[解决办法]
InvalidateRect API函数可以解决问题,帮助中说明如下:

The InvalidateRect function adds a rectangle to the specified window's update region. The update region represents the portion of the window's client area that must be redrawn.

BOOL InvalidateRect(
HWND hWnd,// handle of window with changed update region
CONST RECT *lpRect,// address of rectangle coordinates
BOOL bErase// erase-background flag
);

读书人网 >.NET

热点推荐