示例#1
0
        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
0
        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
0
文件: VCR.cs 项目: sal1n/lcog-client
        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
0
 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
0
        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
0
        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
0
        //ö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);
                }
            }
        }