本文整理汇总了C#中System.Video.Play方法的典型用法代码示例。如果您正苦于以下问题:C# Video.Play方法的具体用法?C# Video.Play怎么用?C# Video.Play使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Video
的用法示例。
在下文中一共展示了Video.Play方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Tutorial_Load
private void Tutorial_Load(object sender, EventArgs e)
{
int height = pnlTV.Height;
int width = pnlTV.Width;
try
{
video = new Video(System.IO.Path.Combine(Application.StartupPath, "RaagaHacker.avi"), false);
video.Owner = pnlTV;
pnlTV.Width = width;
pnlTV.Height = height;
video.Play();
}
catch (Exception ex)
{
frmException frm = new frmException();
frm.ExceptionDialogTitle = "Tutorial_Load: Uanble to play video ";
frm.ErrorMessage = ex.Message;
frm.StrackTrace = ex.StackTrace;
if (frm.ShowDialog() == DialogResult.OK)
{
frm.Dispose();
frm = null;
}
}
finally
{
if (video != null)
{
video.Dispose();
video = null;
}
}
}
示例2: Test_Load
private void Test_Load(object sender, EventArgs e)
{
var image = new Bitmap(PathPic);
pictureBox1.Image = image;
_myVideo = new Video(_pathVideo) {Owner = panel2};
_myVideo.Play();
scrollingText1.ScrollText = TextScroll;
scrollingText1.TextScrollEnabled=true;
}
示例3: b_Click
void b_Click(object sender, EventArgs e)
{
Button b = (Button)sender;
if (this.video != null)
{
this.video.Dispose();
}
this.video = new Video(b.Name);
video.Size = this.panel.Size;
video.Owner = this.panel;
video.Play();
}
示例4: VideoSet
public VideoSet(string Path, ref Panel Owner)
{
//TODO Проверить, если кол-во кадров видео длиннее uint'а, лол, это же видео должно быть под 10 000 часов.
VideoStream = new Video(Path);
VideoStream.CurrentPosition = 0;
int a = Owner.Width; //TODO DeNorkoman it
int b = Owner.Height;
VideoStream.Owner = Owner;
Owner.Width = a;
Owner.Height = b;
Owner.Height = VideoStream.Size.Height * Owner.Width / VideoStream.Size.Width;
Owner.Width = Owner.Width;
frameEnd = (uint)(VideoStream.Duration / VideoStream.AverageTimePerFrame);
VideoStream.Play();
VideoStream.Pause();
}
示例5: PlayThisMovie
private void PlayThisMovie(string sThisMovie)
{
if (Movie != null)
Form_Closing(null, null);
//Movie_Timer.Enabled = false;
Movie_Timer_Enabled = false;
Movie_Track.Enabled = false;
Movie_Track.Value = 0;
BTN_Play.Enabled = BTN_Pause.Enabled = BTN_Stop.Enabled = false;
string sMovieName = sThisMovie;
int LastIndex = sMovieName.LastIndexOf(@"\");
sMovieName = sMovieName.Substring(LastIndex + 1, (sMovieName.Length - LastIndex - 1));
try
{
Movie = new Video(sThisMovie);
}
catch
{
MessageBox.Show("Unable to play " + sMovieName);
return;
}
MovieDefaultSize = Movie.DefaultSize;
int UseWidth = Math.Max(MovieDefaultSize.Width, InitialClientWidth);
int UseHeight = MovieDefaultSize.Height;
Aspect = (float)((float)MovieDefaultSize.Width / (float)MovieDefaultSize.Height);
HDmovie = false;
if (UseWidth >= 1200)
{
UseWidth = (int)(UseWidth * .5f);
UseHeight = (int)(UseHeight * .5f);
HDmovie = true;
}
this.ClientSize = new Size(UseWidth, UseHeight + Movie_Menu.Height + CommandPanel.Height);
Movie.Owner = this.Screen;
Movie_Track.Enabled = true;
Movie_Track.Value = 0;
MovieDuration = (int)Movie.Duration;
Movie_Track.Maximum = 10 * MovieDuration;
hours = MovieDuration / 3600;
minutes = (MovieDuration - hours * 3600) / 60;
seconds = (MovieDuration - hours * 3600 - minutes * 60);
string HH = ("00" + hours.ToString());
HH = HH.Substring(HH.Length - 2, 2);
string MM = ("00" + minutes.ToString());
MM = MM.Substring(MM.Length - 2, 2);
string SS = ("00" + seconds.ToString());
SS = SS.Substring(SS.Length - 2, 2);
movieDuration = HH + ":" + MM + ":" + SS;
durationTime.Text = "/ " + movieDuration;
if (MuteMode)
{
Movie.Audio.Volume = -10000;
}
else
{
Movie.Audio.Volume = Convert.ToInt32((100 - Sound_Track.Value) * -50);
}
this.Text = sMovieName.ToLower();
BTN_Play.Visible = false;
BTN_Pause.Visible = true;
BTN_Pause.Enabled = BTN_Stop.Enabled = BTN_FullScreen.Enabled = true;
BTN_FullScreen.Enabled = true;
MAIN_Form_Resize(null, null);
Movie.Play();
Movie_Timer_Enabled = true;
}
示例6: Playback
public void Playback(string fileName, System.Windows.Forms.PictureBox panel)
{
ourVideo = new Video(fileName);
ourVideo.Ending += new System.EventHandler(this.ClipEnded);
// get bounds values
int x = panel.Bounds.X;
int y = panel.Bounds.Y;
int height = panel.Bounds.Height;
int width = panel.Bounds.Width;
ourVideo.Owner = panel;
// we have to set bounds again coz when playing the video, it increases the
// size of the control for "some reason"..!!
panel.SetBounds(x, y, width, height);
// Start playing now
ourVideo.Play();
}
示例7: OpenVideo
//öffnet neues Video
void OpenVideo()
{
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
try
{
DXvideo = new Video(openFileDialog.FileName, false);
DXvideo.Owner = VideoPanel;
DXvideo.Ending += new EventHandler(video_Ending);
DXvideo.Play();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "Fehler!", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}