/// <summary>
        /// Creates a buffer reference from the bitmap. Please Lock the bitmap before calling this method.
        /// </summary>
        /// <param name="w">The w.</param>
        /// <returns>The corresponding buffer</returns>
        internal static BitmapDataBuffer FromWriteableBitmap(WriteableBitmap w)
        {
            var result = new BitmapDataBuffer(
                w.BackBuffer, w.BackBufferStride, w.Format.BitsPerPixel / 8, w.PixelWidth, w.PixelHeight, w.DpiX, w.DpiY);

            return(result);
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RenderingVideoEventArgs" /> class.
 /// </summary>
 /// <param name="bitmap">The bitmap.</param>
 /// <param name="stream">The stream.</param>
 /// <param name="closedCaptions">The closed captions.</param>
 /// <param name="smtpeTimecode">The smtpe timecode.</param>
 /// <param name="pictureNumber">The picture number.</param>
 /// <param name="startTime">The start time.</param>
 /// <param name="duration">The duration.</param>
 /// <param name="clock">The clock.</param>
 internal RenderingVideoEventArgs(BitmapDataBuffer bitmap, StreamInfo stream, ClosedCaptionCollection closedCaptions, string smtpeTimecode, int pictureNumber, TimeSpan startTime, TimeSpan duration, TimeSpan clock)
     : base(stream, startTime, duration, clock)
 {
     PictureNumber  = pictureNumber;
     Bitmap         = bitmap;
     SmtpeTimecode  = smtpeTimecode;
     ClosedCaptions = closedCaptions;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RenderingVideoEventArgs" /> class.
 /// </summary>
 /// <param name="bitmap">The bitmap.</param>
 /// <param name="closedCaptions">The closed captions.</param>
 /// <param name="smtpeTimeCode">The smtpe time code.</param>
 /// <param name="pictureNumber">The picture number.</param>
 /// <param name="engineState">The engine.</param>
 /// <param name="stream">The stream.</param>
 /// <param name="startTime">The start time.</param>
 /// <param name="duration">The duration.</param>
 /// <param name="clock">The clock.</param>
 internal RenderingVideoEventArgs(
     BitmapDataBuffer bitmap,
     ReadOnlyCollection <ClosedCaptionPacket> closedCaptions,
     string smtpeTimeCode,
     long pictureNumber,
     MediaEngineState engineState,
     StreamInfo stream,
     TimeSpan startTime,
     TimeSpan duration,
     TimeSpan clock)
     : base(engineState, stream, startTime, duration, clock)
 {
     PictureNumber  = pictureNumber;
     Bitmap         = bitmap;
     SmtpeTimeCode  = smtpeTimeCode;
     ClosedCaptions = closedCaptions;
 }