如何实现像素级滚屏(100分)

  • 主题发起人 主题发起人 iseek
  • 开始时间 开始时间
I

iseek

Unregistered / Unconfirmed
GUEST, unregistred user!
我用API函数想实现像素级平滑滚屏,但老是出现令人难堪的空白(滚过的地方不刷新),<br>可能是函数调用不对,也可能是某个参数有问题,请高手出手。100分。
 
告诉我你使用的方法。
 
hubdog上提到过,给的例子如下:<br>procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word; <br>Shift: TShiftState); <br>begin <br>if Key = VK_F8 then <br>SendMessage(Memo1.Handle, { HWND of the Memo Control } <br>WM_VSCROLL, { Windows Message } <br>SB_PAGEDOWN, { Scroll Command } <br>0) { Not Used } <br>else if Key = VK_F7 then <br>SendMessage(Memo1.Handle, { HWND of the Memo Control } <br>WM_VSCROLL, { Windows Message } <br>SB_PAGEUP, { Scroll Command } <br>0); { Not Used } <br>end; <br><br>这个例子中用的是pageDown或pageUp参数,<br>这个函数的原型是:<br>The WM_VSCROLL message is sent to a window when a scroll event occurs in the window's standard vertical scroll bar. This message is also sent to the owner of a vertical scroll bar control when a scroll event occurs in the control. <br><br>WM_VSCROLL &nbsp;<br>nScrollCode = (int) LOWORD(wParam); // scroll bar value <br>nPos = (short int) HIWORD(wParam); &nbsp;// scroll box position <br>hwndScrollBar = (HWND) lParam; &nbsp; &nbsp; &nbsp;// handle of scroll bar <br>&nbsp;<br><br>Parameters<br><br>nScrollCode<br><br>Value of the low-order word of wParam. Specifies a scroll bar value that indicates the user's scrolling request. This parameter can be one of the following values: <br><br>Value Meaning<br>SB_BOTTOM Scrolls to the lower right.<br>SB_ENDSCROLL Ends scroll.<br>SB_LINEDOWN Scrolls one line down.<br>SB_LINEUP Scrolls one line up.<br>SB_PAGEDOWN Scrolls one page down.<br>SB_PAGEUP Scrolls one page up.<br>SB_THUMBPOSITION Scrolls to the absolute position. The current position is specified by the nPos parameter.<br>SB_THUMBTRACK Drags scroll box to the specified position. The current position is specified by the nPos parameter.<br>SB_TOP Scrolls to the upper left.<br>&nbsp;<br><br>nPos<br><br>Value of the high-order word of wParam. Specifies the current position of the scroll box if the <br>nScrollCode parameter is SB_THUMBPOSITION or SB_THUMBTRACK; otherwise, nPos is not used. <br><br>hwndScrollBar<br><br>Value of lParam. Identifies the control if WM_VSCROLL is sent by a scroll bar control. If WM_VSCROLL is sent by a window's standard scroll bar, hwndScrollBar is not used. <br><br>&nbsp;<br><br>Return Values<br><br>If an application processes this message, it should return zero. <br><br>Remarks<br><br>The SB_THUMBTRACK notification message is typically used by applications that provide feedback as the user drags the scroll box. <br>If an application scrolls the content of the window, it must also reset the position of the scroll box by using the SetScrollPos function. <br>Note that the WM_VSCROLL message carries only 16 bits of scroll box position data. Thus, applications that rely solely on WM_VSCROLL (and WM_HSCROLL) for scroll position data have a practical maximum position value of 65,535. <br><br>However, because the SetScrollPos, SetScrollRange, GetScrollPos, and GetScrollRange functions support 32-bit scroll bar position data, there is a way to circumvent the 16-bit barrier of the WM_HSCROLL and WM_VSCROLL messages. See GetScrollPos for a description of the technique and its limits. <br><br>See Also<br><br>GetScrollPos, GetScrollRange, SetScrollPos, SetScrollRange, WM_HSCROLL <br>=========================================================================<br>好像还有其他函数可以滚屏,我记得当时试过,但记不太清了<br>星际浪人如果有答案请告诉我,谢谢。<br>
 
cemi,能不能给几句代码,先谢过。<br>
 
我用scrollwindowex函数滚屏,但还是不行。有两个参数不知道该怎样填。<br>难道没有人会?<br>难道用DELPHI只能一行或几行一页或几页地滚?<br>难道真是DELPHI不如VC?
 
难道没人会?
 
&nbsp;sendmessage(memo1.handle,EM_LINESCROLL,memo1.selstart,3)<br>可不可以?<br>
 
用AnimateWindow函数<br>能实现网络蚂蚊的效果
 
to eagle_han<br>好像不行吧,我要的是平滑滚动
 
我以前也试过,但是也没成功<br>关注
 
大家去看看这个帖子<br><br>http://www.delphibbs.com/delphibbs/dispq.asp?lid=623296
 
我已经自己解决了。<br>谢谢各位。<br>分就送给大家。<br>
 
后退
顶部