Skip to content

DrawMovie

Narta Xaymar Dirks edited this page Oct 28, 2026 · 9 revisions

Blitz3DBlitzPlusBlitzBasic

DrawMovie

DrawMovie:Int32 movie:Int32, x:Int32=0, y:Int32=0, w:Int32=-1, h:Int32=-1
Parameter Mode Type Default Description
movie In Int32 required A movie handle from OpenMovie.
x In Int32 0 Horizontal position of the top left corner. Defaults to 0.
y In Int32 0 Vertical position of the top left corner. Defaults to 0.
w In Int32 -1 Width to draw at. Defaults to the width of the movie.
h In Int32 -1 Height to draw at. Defaults to the height of the movie.

Returns: 1 while the movie is still playing, 0 once it has ended or was stopped.

Description

Draws the current picture of a movie into the current buffer. For a video the movie plays by itself at its normal speed and DrawMovie shows the newest picture, so call it once per frame. The position and size are in screen pixels, the origin and viewport are ignored, and the movie has to lie completely inside the screen.

Differences

  • Draws the newest picture whose time has come, stretched to the size given (smooth, not pixel by pixel). It does not look at the origin and viewport, like the original, and a movie that goes over the edge of the screen is cut at it. What a program shows at the start, in the middle and at the end of a 3 second movie, drawn at its size, at a smaller size and at a bigger one, is in drawmovie_start.png, drawmovie_middle.png and drawmovie_end.png (made by tools/render_movie_samples.py).
  • A debug build (-d) stops the program when the movie does not exist, for example the 0 of a movie that failed to open, other builds ignore the command, see Debug handle checks.

Examples

Graphics 320, 240, 0, 2
SetBuffer BackBuffer()
Local m = OpenMovie("movie.avi")
If m = 0 Then
	Print "No movie.avi to play"
	WaitKey
	End
EndIf
While MoviePlaying(m) And Not KeyHit(1)
	Cls
	DrawMovie m, 0, 0, 320, 240
	Flip
Wend
CloseMovie m

Related Commands

CloseMovie, GetMovieTexture 〔BlitzLLVM〕, LoopMovie 〔BlitzLLVM〕, OpenMovie, PauseMovie 〔BlitzLLVM〕, PlayMovie 〔BlitzLLVM〕, SeekMovie 〔BlitzLLVM〕, StopMovie 〔BlitzLLVM〕

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally