如何播放影片
出自VFP Wiki
如何播放影片
的原始碼
跳轉到:
導航
,
搜尋
根據以下的原因,您並無權限去做編輯這個頁面:
你所請求執行的操作被禁止。
你可以檢視並複製本頁面的原始碼。
[[category:多媒體]] ====如何播放影片==== 出處:[http://blogs.msdn.com/calvin_hsia/archive/2006/09/28/775829.aspx Calvin Hsia's WebLog : Play movies with an ActiveX control] 摘錄程式碼如下(The following code is cliped from the above article): <pre> PUBLIC ox as MyForm ox=CREATEOBJECT("MyForm") *Regsvr32 c:\WINDOWS\system32\msdxm.ocx DEFINE CLASS MyForm as Form height=900 width = 1124 oEv=0 && Event handler ref allowoutput=.f. fLoaded=.f. ADD OBJECT oc AS OleControl with; oleclass="AMOVIE.ActiveMovieControl.2" PROCEDURE init cFilename="d:\slides.avi" this.oc.width=thisform.Width this.oc.height= thisform.Height this.oc.filename=cFilename this.oEv = CREATEOBJECT("evHandler",this) EVENTHANDLER(this.oc.object,this.oEv) IF thisform.Left < 0 or thisform.Left > SYSMETRIC(1)-100 && on 2nd monitor thisform.oc.object.MovieWindowSize= 1 ELSE thisform.oc.object.MovieWindowSize= 4 && amvOneHalfScreen ENDIF this.Show DO WHILE !thisform.fLoaded *!* DO WHILE this.oc.object.currentstate = -1 IF INKEY(.5)=27 EXIT ENDIF ENDDO thisform.oc.object.run ENDDEFINE DEFINE CLASS evHandler AS custom IMPLEMENTS DActiveMovieEvents2 IN "C:\WINDOWS\SYSTEM32\AMCOMPAT.TLB" oForm=null PROCEDURE init(oForm) this.oForm=oForm PROCEDURE DActiveMovieEvents2_StateChange(oldState AS Number, newState AS Number) AS VOID; HELPSTRING "Indicates that the current state of the movie has changed" * add user code here ENDPROC PROCEDURE DActiveMovieEvents2_PositionChange(oldPosition AS Number, newPosition AS Number) AS VOID; HELPSTRING "Indicates that the current position of the movie has changed" * add user code here ENDPROC PROCEDURE DActiveMovieEvents2_Timer() AS VOID; HELPSTRING "ActiveMovie Control's progress timer" * add user code here ENDPROC PROCEDURE DActiveMovieEvents2_OpenComplete() AS VOID; HELPSTRING "Reports that an asynchronous operation to open a file has completed successfully" ?PROGRAM() this.oform.fLoaded=.t. ENDPROC PROCEDURE DActiveMovieEvents2_Click() AS VOID * add user code here ENDPROC PROCEDURE DActiveMovieEvents2_DblClick() AS VOID * add user code here ENDPROC PROCEDURE DActiveMovieEvents2_KeyDown(KeyCode AS INTEGER, Shift AS INTEGER) AS VOID * add user code here ENDPROC PROCEDURE DActiveMovieEvents2_KeyUp(KeyCode AS INTEGER, Shift AS INTEGER) AS VOID * add user code here ENDPROC PROCEDURE DActiveMovieEvents2_KeyPress(KeyAscii AS INTEGER) AS VOID * add user code here ENDPROC PROCEDURE DActiveMovieEvents2_MouseDown(Button AS INTEGER, Shift AS INTEGER, x AS Number, y AS Number) AS VOID * add user code here ENDPROC PROCEDURE DActiveMovieEvents2_MouseMove(Button AS INTEGER, Shift AS INTEGER, x AS Number, y AS Number) AS VOID * add user code here ENDPROC PROCEDURE DActiveMovieEvents2_MouseUp(Button AS INTEGER, Shift AS INTEGER, x AS Number, y AS Number) AS VOID * add user code here ENDPROC PROCEDURE DActiveMovieEvents2_Error(SCode AS INTEGER, Description AS STRING, Source AS STRING, CancelDisplay AS LOGICAL) AS VOID * add user code here ENDPROC PROCEDURE DActiveMovieEvents2_DisplayModeChange() AS VOID; HELPSTRING "Indicates that the display mode of the movie has changed" * add user code here ENDPROC PROCEDURE DActiveMovieEvents2_ReadyStateChange(ReadyState AS VARIANT) AS VOID; HELPSTRING "Reports that the ReadyState property of the ActiveMovie Control has changed" * add user code here ENDPROC PROCEDURE DActiveMovieEvents2_ScriptCommand(bstrType AS STRING, bstrText AS STRING) AS VOID * add user code here ENDPROC ENDDEFINE </pre>
返回到
如何播放影片
。
檢視
頁面
討論
原始碼
歷史
個人工具
登入/建立新帳號 選單
導航
首頁
社群入口
現時事件
近期變動
隨機頁面
使用說明
搜尋
工具箱
鏈入頁面
相關頁面修訂記錄
所有特殊頁面