Enables an object to scroll an area within its in-place active image on the screen.
HRESULT ScrollRect(
int dx, |
//Amount to scroll on the x-axis |
int dy, |
//Amount to scroll on the y-axis |
LPCRECT pRectScroll, |
//Rectangle to scroll |
LPCRECT pRectClip |
//Rectangle to clip |
); |
Parameters
Return Values
Remarks
This method should take in account the fact that the caller may be transparent and that there may be opaque or transparent overlapping objects. See Notes to Implementers below for suggestions on algorithms this method can use.
Containers can implement this method in a variety of ways. However, all of them should account for the possibility that the object requesting scrolling may be transparent or may not have a solid background. Containers should also take into account that there may be overlapping objects.
The simplest way to implement this method consists in simply redrawing the rectangle to scroll.
An added refinement to this simple implementation is to use the ScrollDC Windows API function when the object requesting the scroll is opaque, the object has a solid background, and there are no overlapping objects.
More sophisticated implementations can use the following procedure:
Regardless of the scrolling and clipping rectangle, only pixels contained in the object’s site rectangle will be painted. The area uncovered by the scrolling operation is invalidated and redrawn immediately, before this method returns.
All redraw generated by this method should happen synchronously before this method returns.
This method should automatically hide the caret during the scrolling operation and should move the caret by the scrolling amounts if it is inside the clip rectangle.
See Also
IViewObjectEx::GetViewStatus, IViewObjectEx::GetRect