level 14
起帆远航
楼主
今天找大话图片资源,看到了新大话2的宣传影片,觉得挺好看,所以就下载了下来,想着用blitzbasic做个播放器,就做了简单的,代码如下:
blitzplus代码:
;我这里设置的显示大小做的与影片一样,大家可以修改。
Const WIDTH = 1280
Const HEIGHT = 720
; 窗口图形模式
Graphics WIDTH, HEIGHT,32,2
SetBuffer BackBuffer()
;打开 movie 文件,支持AVI 和 MPEG,其他没试。下面大家可以改成自己的影片名称
movie=OpenMovie("G:\2pic\ppz.wmv")
MoviePlaying(movie)
;period=100 ; 这里我是用来播放gif动画做的帧数时间设置
;time=MilliSecs()
; And here*s the main loop
Repeat
;GIF播放的话需要这里设置下fps
;Repeat
; do nothing
;Until MilliSecs()-time>=period
;time=MilliSecs() ; save the current time for the next frame
DrawMovie movie,0,0,1280,720 ; 播放影片
Flip
Until KeyHit(1) ; Escape to exit
CloseMovie(movie)
End
blitz3d代码:
Graphics3D 1280,720,16,2
AppTitle "BlitzMedia Player! "
SetBuffer BackBuffer()
.begin
Cls
Global moviename$="G:\2pic\ppz.wmv"
If FileType(moviename)=1
size$=Input$("Fullscreen? (Y/N)")
movie=OpenMovie(moviename)
Cls
Else
Print "Movie doesn*t exist!......press any key to continue!"
WaitKey()
Goto begin
EndIf
While Not KeyDown(1)
If size="y" Then DrawMovie movie,0,0,1280,720
If size="n" Then DrawMovie movie,0,0
If MoviePlaying(movie)=False Then Delay 3000 : Exit
UpdateWorld
RenderWorld
Flip
Wend
CloseMovie movie
End

2014年11月04日 14点11分
1
blitzplus代码:
;我这里设置的显示大小做的与影片一样,大家可以修改。
Const WIDTH = 1280
Const HEIGHT = 720
; 窗口图形模式
Graphics WIDTH, HEIGHT,32,2
SetBuffer BackBuffer()
;打开 movie 文件,支持AVI 和 MPEG,其他没试。下面大家可以改成自己的影片名称
movie=OpenMovie("G:\2pic\ppz.wmv")
MoviePlaying(movie)
;period=100 ; 这里我是用来播放gif动画做的帧数时间设置
;time=MilliSecs()
; And here*s the main loop
Repeat
;GIF播放的话需要这里设置下fps
;Repeat
; do nothing
;Until MilliSecs()-time>=period
;time=MilliSecs() ; save the current time for the next frame
DrawMovie movie,0,0,1280,720 ; 播放影片
Flip
Until KeyHit(1) ; Escape to exit
CloseMovie(movie)
End
blitz3d代码:
Graphics3D 1280,720,16,2
AppTitle "BlitzMedia Player! "
SetBuffer BackBuffer()
.begin
Cls
Global moviename$="G:\2pic\ppz.wmv"
If FileType(moviename)=1
size$=Input$("Fullscreen? (Y/N)")
movie=OpenMovie(moviename)
Cls
Else
Print "Movie doesn*t exist!......press any key to continue!"
WaitKey()
Goto begin
EndIf
While Not KeyDown(1)
If size="y" Then DrawMovie movie,0,0,1280,720
If size="n" Then DrawMovie movie,0,0
If MoviePlaying(movie)=False Then Delay 3000 : Exit
UpdateWorld
RenderWorld
Flip
Wend
CloseMovie movie
End
