Beispiel #1
0
        public override sealed void Render()
        {
            if (_bitmapLock.TryEnterReadLock(20))
            {
                //绘制缓冲图像
                BufferBitmapRenderTarget.BeginDraw();
                Render(BufferBitmapRenderTarget);
                BufferBitmapRenderTarget.EndDraw();

                SurfaceRenderTarget.BeginDraw();
                SurfaceRenderTarget.DrawBitmap(BufferBitmapRenderTarget.Bitmap, 1,
                                               BitmapInterpolationMode.Linear);
                SurfaceRenderTarget.EndDraw();

                _bitmapLock.ExitReadLock();
            }
        }
Beispiel #2
0
        public override sealed void Render()
        {
            var captureTime = _foregroundBitmap.TimeStamps["CaptureTime"];

            ProcessTimeSpan = DateTime.Now - captureTime;

            BufferBitmapRenderTarget.Bitmap.CopyFromMemory(_foregroundBitmap.Buffer,
                                                           _foregroundBitmap.Stride);

            BufferBitmapRenderTarget.BeginDraw();
            Render(BufferBitmapRenderTarget);
            BufferBitmapRenderTarget.EndDraw();

            //渲染缓冲图像到界面
            SurfaceRenderTarget.BeginDraw();
            //重要操作,清理以前绘制结果为透明黑色背景,无此行界面绘制结果会累加
            SurfaceRenderTarget.Clear(null);

            SurfaceRenderTarget.DrawBitmap(BufferBitmapRenderTarget.Bitmap, 1,
                                           BitmapInterpolationMode.Linear);

            SurfaceRenderTarget.EndDraw();
        }