Table of Contents

Class VideoPlayer

Namespace
Bonsai.Vision.Design
Assembly
Bonsai.Vision.Design.dll

Represents a graphics accelerated video player control.

public class VideoPlayer : UserControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, IContainerControl
Inheritance
VideoPlayer
Implements
Inherited Members

Constructors

VideoPlayer()

Initializes a new instance of the VideoPlayer class.

public VideoPlayer()

Properties

Canvas

Gets the graphics canvas used to render video frames.

public VisualizerCanvas Canvas { get; }

Property Value

VisualizerCanvas

FrameCount

Gets or sets the number of frames in the video.

public int FrameCount { get; set; }

Property Value

int

Loop

Gets or sets a value indicating whether the video should loop when the end of the file is reached.

public bool Loop { get; set; }

Property Value

bool

PlaybackRate

Gets or sets the speed, in frames per second, at which to play images from the video.

public double PlaybackRate { get; set; }

Property Value

double

Playing

Gets or sets a value specifying whether the video is playing.

public bool Playing { get; set; }

Property Value

bool

Methods

Dispose(bool)

Clean up any resources being used.

protected override void Dispose(bool disposing)

Parameters

disposing bool

true if managed resources should be disposed; otherwise, false.

OnLoad(EventArgs)

Raises the Load event.

protected override void OnLoad(EventArgs e)

Parameters

e EventArgs

An EventArgs that contains the event data.

OnPlaybackRateChanged(EventArgs)

Raises the PlaybackRateChanged event.

protected virtual void OnPlaybackRateChanged(EventArgs e)

Parameters

e EventArgs

A EventArgs that contains the event data.

OnPlayingChanged(EventArgs)

Raises the PlayingChanged event.

protected virtual void OnPlayingChanged(EventArgs e)

Parameters

e EventArgs

A EventArgs that contains the event data.

OnSeek(SeekEventArgs)

Raises the Seek event.

protected virtual void OnSeek(SeekEventArgs e)

Parameters

e SeekEventArgs

A SeekEventArgs that contains the event data.

ProcessCmdKey(ref Message, Keys)

Processes a command key.

protected override bool ProcessCmdKey(ref Message msg, Keys keyData)

Parameters

msg Message

A Message, passed by reference, that represents the window message to process.

keyData Keys

One of the Keys values that represents the key to process.

Returns

bool

true if the character was processed by the control; otherwise, false.

Update(IplImage, int)

Updates the video player control with the specified frame.

public void Update(IplImage frame, int frameNumber)

Parameters

frame IplImage

An IplImage object containing the pixel data of the current video frame.

frameNumber int

The zero-based index of the current video frame.

Events

LoopChanged

Occurs when the Loop property value changes.

public event EventHandler LoopChanged

Event Type

EventHandler

PlaybackRateChanged

Occurs when the PlaybackRate property value changes.

public event EventHandler PlaybackRateChanged

Event Type

EventHandler

PlayingChanged

Occurs when the Playing property value changes.

public event EventHandler PlayingChanged

Event Type

EventHandler

Seek

Occurs when the user moves the video seek bar.

public event EventHandler<SeekEventArgs> Seek

Event Type

EventHandler<SeekEventArgs>