/////////////////////////////////////////////////////////////////////////////// // Construction and Initializing methods // /////////////////////////////////////////////////////////////////////////////// #region CONSTRUCTION /// <summary> /// Initializes a new instance of the ImageFromVectorGraphics class. /// </summary> /// <param name="newVideoProperties">A <see cref="CaptureDeviceProperties"/> with the properties to use for this object.</param> /// <param name="newSectionStartTime">A <see cref="long"/> with the start time of the video section.</param> /// <param name="newSectionEndTime">A <see cref="long"/> with the end time of the video section.</param> /// <param name="newVideoFramePusher">A <see cref="VideoFramePusher"/> that populates the image with a background video frame.</param> /// <param name="newImageRenderer">The <see cref="Ogama.Modules.Replay.ReplayPicture.RenderFrameHandler"/> that is the delegate to get the images from.</param> public ImageFromVectorGraphics( CaptureDeviceProperties newVideoProperties, long newSectionStartTime, long newSectionEndTime, VideoFramePusher newVideoFramePusher, Ogama.Modules.Replay.ReplayPicture.RenderFrameHandler newImageRenderer) { int fps = newVideoProperties.FrameRate; this.framesPerSecond = UNIT / fps; this.frameTimeSpan = (int)(1000f / fps); this.videoSize = newVideoProperties.VideoSize; this.sectionStartTime = newSectionStartTime; this.sectionEndTime = newSectionEndTime; this.videoFramePusher = newVideoFramePusher; this.imageRenderer = newImageRenderer; }
/////////////////////////////////////////////////////////////////////////////// // Methods and Eventhandling for Background tasks // /////////////////////////////////////////////////////////////////////////////// #region THREAD #endregion //THREAD /////////////////////////////////////////////////////////////////////////////// // Methods for doing main class job // /////////////////////////////////////////////////////////////////////////////// #region PRIVATEMETHODS /// <summary> /// This method fills the <see cref="CaptureDeviceProperties"/> according to the current selections. /// </summary> /// <returns>The <see cref="CaptureDeviceProperties"/> according to the current selections.</returns> private CaptureDeviceProperties GetVideoProperties() { CaptureDeviceProperties currentProperties = new CaptureDeviceProperties(); if (this.cbbVideoCompressor.SelectedItem != null) { currentProperties.VideoCompressor = this.cbbVideoCompressor.SelectedItem.ToString(); } if (this.cbbAudioCompressor.SelectedItem != null) { currentProperties.AudioCompressor = this.cbbAudioCompressor.SelectedItem.ToString(); } if (this.cbbVideoSize.SelectedItem != null) { string[] sizes = this.cbbVideoSize.SelectedItem.ToString().Split('x'); currentProperties.VideoSize = new Size(Convert.ToInt32(sizes[0]), Convert.ToInt32(sizes[1])); } currentProperties.FrameRate = (int)this.nudFrameRate.Value; return(currentProperties); }