internal void AddBodyFrame(DrawingImage drawingImage) { if (this.isRecording) { //DateTime now = DateTime.Now; //TimeSpan timeSpan = this.StartDate.Subtract(now); //string path = this.GetBodyFramePath() + now.GetStringTime() + ".png"; //RenderTargetBitmap bitmap = drawingImage.ToBitmap(); //frames.Add(new Frame(bitmap.Clone(), path, timeSpan, Frame.FrameType.Body)); ////bitmap.ToImageFile(path); _Frame frame; TimeSpan timeWithPreviousFrame; DateTime now = DateTime.Now; TimeSpan timeSpan = now.Subtract(this.StartDate); string path = this.GetColorFramePath() + now.GetStringTime() + ".png"; if (this.previousFrame == null) { timeWithPreviousFrame = timeSpan; } else { timeWithPreviousFrame = timeSpan.Subtract(this.previousFrame.Time); } RenderTargetBitmap bitmap = drawingImage.ToBitmap(); frame = new _Frame(bitmap.Clone(), path, timeSpan, timeWithPreviousFrame, _Frame.FrameType.Body); this.previousFrame = frame; frames.Add(frame); //bitmap.ToImageFile(path); } }