Пример #1
0
        private void RenderImageThatMasksText(VideoInterpreter.VideoCapture frame, IBoundingBox invalidatedRegion)
        {
            frame.CopyToWriteableBitmap(BackgroundOverlayImage, invalidatedRegion);
            BackgroundOverlay.Width  = frame.Width;
            BackgroundOverlay.Height = frame.Height;

            foreach (var textLoc in TextLocations)
            {
                CopyBitmapToWriteableBitmap(_backgroundBitmap, BackgroundOverlayImage, textLoc.TreeNode);
            }
        }
Пример #2
0
        public void WriteBackgroundAndRender(Tree tree)
        {
            VideoInterpreter.VideoCapture capture = tree["videocapture"] as VideoInterpreter.VideoCapture;
            IBoundingBox invalidatedpixels        = tree["invalidated"] as IBoundingBox;

            //Todo: this is not working properly - returning null when there is a change...
            List <Tree> contentRegionBoxes = GetContentRegionBoxes(tree);

            if (invalidatedpixels != null)
            {
                _backgroundBitmap.Width  = tree.Width;
                _backgroundBitmap.Height = tree.Height;

                WriteBackgroundPixels(_backgroundBitmap, contentRegionBoxes, tree);
                Dispatcher.BeginInvoke(_update, capture, tree, contentRegionBoxes, tree);
            }
            else
            {
                WriteBackgroundPixels(_backgroundBitmap, contentRegionBoxes, tree);
                Dispatcher.BeginInvoke(_update, capture, tree, contentRegionBoxes, null);
            }
        }
Пример #3
0
 private void UIThreadUpdate(VideoInterpreter.VideoCapture frame, Tree root, List <Tree> textNodes, IBoundingBox invalidated)
 {
     SetTextBoxes(textNodes, root);
     RenderImageThatMasksText(frame, invalidated);
 }