lpClipRect
Pointer to the RECT structure containing the coordinates of the clipping rectangle. Only device bits within the clipping rectangle are affected. Bits scrolled from the outside of the rectangle to the inside are painted; bits scrolled from the inside of the rectangle to the outside are not painted.
什么叫做 ··由外向内的滚动矩形内部被着色,而由矩形内向外的滚动将不被着色。
帮我解释下。scrollwindow中有两个函数xmount,ymount,代表的是x和y的移动量,说向左为负,向右为正,向下为正,向上为负。
那下面这个函数为什么下面这一小段的代码代表的意思却与之相反,而且只有这样写才能运行。
ScrollWindow(hWnd, xChar * (HScrollPos -si.nPos ), 0, NULL, NULL);
UpdateWindow (hWnd);
ScrollWindow(hWnd, 0, yChar * (VScrollPos - si.nPos), NULL, NULL);
UpdateWindow (hWnd);
HScrollPos和VScrollPos代表的是未移动前的滚动条的位置,si.nPos则显然代表的是移动后的滚动条位置。
如果向下移或向右移,明显si.nPos要比HScrollPos和VScrollPos都大,减出来肯定是负的。
Pointer to the RECT structure containing the coordinates of the clipping rectangle. Only device bits within the clipping rectangle are affected. Bits scrolled from the outside of the rectangle to the inside are painted; bits scrolled from the inside of the rectangle to the outside are not painted.
什么叫做 ··由外向内的滚动矩形内部被着色,而由矩形内向外的滚动将不被着色。
帮我解释下。scrollwindow中有两个函数xmount,ymount,代表的是x和y的移动量,说向左为负,向右为正,向下为正,向上为负。
那下面这个函数为什么下面这一小段的代码代表的意思却与之相反,而且只有这样写才能运行。
ScrollWindow(hWnd, xChar * (HScrollPos -si.nPos ), 0, NULL, NULL);
UpdateWindow (hWnd);
ScrollWindow(hWnd, 0, yChar * (VScrollPos - si.nPos), NULL, NULL);
UpdateWindow (hWnd);
HScrollPos和VScrollPos代表的是未移动前的滚动条的位置,si.nPos则显然代表的是移动后的滚动条位置。
如果向下移或向右移,明显si.nPos要比HScrollPos和VScrollPos都大,减出来肯定是负的。
lpClipRect
Pointer to the RECT structure containing the coordinates of the clipping rectangle. Only device bits within the clipping rectangle are affected
就是表示需要重画的区域
我挂了很久了,一直没人答所以就结了帖,把分给我朋友了。
哦,这个终于知道了。谢谢啊!
scrollwindow中有两个函数xmount,ymount,代表的是x和y的移动量,说向左为负,向右为正,向下为正,向上为负。 HScrollPos和VScrollPos代表的是未移动前的滚动条的位置,si.nPos则显然代表的是移动后的滚动条位置。
如果向下移或向右移,明显si.nPos要比HScrollPos和VScrollPos都大,减出来肯定是负的。
这个你知道吗?如果知道的话!
我可以另可以你分的。