Exemple #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            var recordFullPath = new StringBuilder(m_FolderName + @"\\SessionRecord-" + m_RecourdCount + ".wmv");

            // Check if we recording or not
            if (m_isRecord)
            {
                RecordTimer.Stop();
                screenCaptureJob.Stop();
                var chooseLessonNameForm = new LessonNameForm(recordFullPath.ToString(), m_userName, m_courseId);
                this.Hide();
                chooseLessonNameForm.ShowDialog();
                this.Show();
                button2.Enabled     = true;
                button1.Enabled     = true;
                m_isRecord          = false;
                button3.Text        = "Start Recording!";
                pictureBox3.Visible = false;
                m_RecourdCount++;
                return;
            }
            else
            {
                button2.Enabled = false;
                button1.Enabled = false;
                m_isRecord      = true;
                button3.Text    = "Stop Recording!";
                RecordTimer.Start();
            }

            try
            {
                Rectangle _screenRectangle = Screen.PrimaryScreen.Bounds;
                screenCaptureJob.CaptureRectangle     = _screenRectangle;
                screenCaptureJob.ShowFlashingBoundary = true;
                screenCaptureJob.ScreenCaptureVideoProfile.FrameRate = 20;
                screenCaptureJob.CaptureMouseCursor = true;

                screenCaptureJob.OutputScreenCaptureFileName = recordFullPath.ToString();
                if (File.Exists(screenCaptureJob.OutputScreenCaptureFileName))
                {
                    File.Delete(screenCaptureJob.OutputScreenCaptureFileName);
                }
                screenCaptureJob.Start();
            }
            catch (Exception) { }
        }
Exemple #2
0
        private void ConvertImagesToPdf()
        {
            SautinSoft.PdfVision v = new SautinSoft.PdfVision();
            v.PageStyle.PageSize.Auto();
            ArrayList arImageBytes = new ArrayList();

            foreach (var filePath in m_filesPath)
            {
                byte[] imageBytes = null;
                imageBytes = ReadByteArrayFromFile(filePath);
                if (imageBytes != null)
                {
                    arImageBytes.Add(imageBytes);
                }
            }

            string pdfFile = null;

            //Now the arImageBytes contains byte streams of each image
            //Lets convert it to PDF stream in memory
            byte[] pdf = v.ConvertImageStreamArrayToPDFStream(arImageBytes);
            if (pdf != null)
            {
                //Save PDF stream to a file
                pdfFile = Path.Combine(m_FolderName, "hardcopy.pdf");
                File.Delete(pdfFile);
                FileStream fs = File.OpenWrite(pdfFile);
                fs.Write(pdf, 0, pdf.Length);
                fs.Close();
            }

            // Open lesson name form
            LessonNameForm lessonNameForm = new LessonNameForm(pdfFile, m_userName, m_courseId);

            this.Hide();
            lessonNameForm.ShowDialog();

            this.Close();
        }
Exemple #3
0
        private void ConvertImagesToPdf()
        {
            SautinSoft.PdfVision v = new SautinSoft.PdfVision();
            v.PageStyle.PageSize.Auto();
            ArrayList arImageBytes = new ArrayList();

            foreach (var filePath in m_filesPath)
            {
                byte[] imageBytes = null;
                imageBytes = ReadByteArrayFromFile(filePath);
                if (imageBytes != null)
                    arImageBytes.Add(imageBytes);
            }

            string pdfFile = null;

            //Now the arImageBytes contains byte streams of each image
            //Lets convert it to PDF stream in memory
            byte[] pdf = v.ConvertImageStreamArrayToPDFStream(arImageBytes);
            if (pdf != null)
            {
                //Save PDF stream to a file
                pdfFile = Path.Combine(m_FolderName, "hardcopy.pdf");
                File.Delete(pdfFile);
                FileStream fs = File.OpenWrite(pdfFile);
                fs.Write(pdf, 0, pdf.Length);
                fs.Close();
            }

            // Open lesson name form
            LessonNameForm lessonNameForm = new LessonNameForm(pdfFile, m_userName, m_courseId);
            this.Hide();
            lessonNameForm.ShowDialog();

            this.Close();
        }
Exemple #4
0
        private void button3_Click(object sender, EventArgs e)
        {
            var recordFullPath = new StringBuilder(m_FolderName + @"\\SessionRecord-" + m_RecourdCount + ".wmv");
            // Check if we recording or not
            if (m_isRecord)
            {
                RecordTimer.Stop();
                screenCaptureJob.Stop();
                var chooseLessonNameForm = new LessonNameForm(recordFullPath.ToString(), m_userName, m_courseId);
                this.Hide();
                chooseLessonNameForm.ShowDialog();
                this.Show();
                button2.Enabled = true;
                button1.Enabled = true;
                m_isRecord = false;
                button3.Text = "Start Recording!";
                pictureBox3.Visible = false;
                m_RecourdCount++;
                return;
            }
            else
            {
                button2.Enabled = false;
                button1.Enabled = false;
                m_isRecord = true;
                button3.Text = "Stop Recording!";
                RecordTimer.Start();
            }

            try
            {
                Rectangle _screenRectangle = Screen.PrimaryScreen.Bounds;
                screenCaptureJob.CaptureRectangle = _screenRectangle;
                screenCaptureJob.ShowFlashingBoundary = true;
                screenCaptureJob.ScreenCaptureVideoProfile.FrameRate = 20;
                screenCaptureJob.CaptureMouseCursor = true;

                screenCaptureJob.OutputScreenCaptureFileName = recordFullPath.ToString();
                if (File.Exists(screenCaptureJob.OutputScreenCaptureFileName))
                {
                    File.Delete(screenCaptureJob.OutputScreenCaptureFileName);
                }
                screenCaptureJob.Start();
            }
            catch (Exception) { }
        }