Type Default Value Read Only Static Description
Double 0 No No The elapsed time in seconds.
Notes

For movies only, the elapsed time in seconds corresponding to the current frame, zero otherwise. Movies do not have a well defined number of images. Particular tracks of a movie may have numbers of frames but these may not be a constant time apart and there may be more than one such track in a movie. You specify an image within a movie by giving a number of seconds from the start.

When the Time is zero it indicates the start of the movie.

At the moment only QuickTime movies support this property. All other formats simply convert the time into a frame number using a constant frame rate.

See Also

Frame

Duration

Example

Here we load a Quicktime movie and print out the movie duration. We then save as a png image the first frame of the movie (the beginning) and the frames at 1 and 2 seconds.

Note that you must have QuickTime installed to load QuickTime movies.

[C#]

Canvas canvas = new Canvas();
XImage image = XImage.FromFile(Server.MapPath("rez/Movie1.mov"));
Response.Write(String.Format("Total Movie Duration {0} seconds.", image.Duration));
DrawOptions drawOpts = new DrawOptions();
canvas.DrawImage(image, drawOpts);
canvas.SaveAs(Server.MapPath("XImage_Time_85_start_of_movie.png"));
image.Time = 1;
canvas.Clear();
canvas.DrawImage(image, drawOpts);
canvas.SaveAs(Server.MapPath("XImage_Time_85_1_second.png"));
image.Time = 2;
canvas.Clear();
canvas.DrawImage(image, drawOpts);
canvas.SaveAs(Server.MapPath("XImage_Time_85_2_seconds.png"));


[Visual Basic]

Dim canvas As New Canvas()
Dim image As XImage = XImage.FromFile(Server.MapPath("rez/Movie1.mov"))
Response.Write([String].Format("Total Movie Duration {0} seconds.", image.Duration))
Dim drawOpts As New DrawOptions()
canvas.DrawImage(image, drawOpts)
canvas.SaveAs(Server.MapPath("XImage_Time_85_start_of_movie.png"))
image.Time = 1
canvas.Clear()
canvas.DrawImage(image, drawOpts)
canvas.SaveAs(Server.MapPath("XImage_Time_85_1_second.png"))
image.Time = 2
canvas.Clear()
canvas.DrawImage(image, drawOpts)
canvas.SaveAs(Server.MapPath("XImage_Time_85_2_seconds.png"))



XImage_Time_85_start_of_movie.png


XImage_Time_85_1_second.png


XImage_Time_85_2_seconds.png