View Issue Details

IDProjectCategoryView StatusLast Update
0001410NoesisGUIC# SDKpublic2019-11-13 11:08
Reporterdarthmaule2Assigned Tojsantos 
PriorityhighSeverityfeatureReproducibilityalways
Status assignedResolutionopen 
Product Version2.2.0b5 
Target VersionFixed in Version 
Summary0001410: Implement WPF's RenderTargetBitmap class
DescriptionI would like WPF's RenderTargetBitmap class to be implemented because this class provides and easy way to render images and UI elements.

        private BitmapSource BlendBitmapSources(BitmapSource backgroundSource, BitmapSource overlaySource)
        {
            if ((backgroundSource.PixelWidth != overlaySource.PixelWidth) ||
                (backgroundSource.PixelHeight != overlaySource.PixelHeight))
                throw new ArgumentException();

            int width = backgroundSource.PixelWidth;
            int height = backgroundSource.PixelHeight;

            Grid renderGrid = new Grid();
            renderGrid.HorizontalAlignment = HorizontalAlignment.Left;
            renderGrid.VerticalAlignment = VerticalAlignment.Top;
            renderGrid.Width = width;
            renderGrid.Height = height;
            renderGrid.Measure(new Size(width, height));
            renderGrid.Arrange(new Rect(new Size(width, height)));
            renderGrid.UpdateLayout();

            Image backgroundImage = new Image();
            backgroundImage.Stretch = Stretch.Fill;
            backgroundImage.Source = backgroundSource;
            renderGrid.Children.Add(backgroundImage);

            Image overlayImage = new Image();
            overlayImage.Stretch = Stretch.Fill;
            overlayImage.Source = overlaySource;
            renderGrid.Children.Add(overlayImage);

            renderGrid.UpdateLayout();

            RenderTargetBitmap renderTargetBitmap = new RenderTargetBitmap(width, height, 96, 96, PixelFormats.Pbgra32);
            renderTargetBitmap.Render(renderGrid);

            return renderTargetBitmap;
        }
TagsNo tags attached.
PlatformAny

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2019-02-23 11:31 darthmaule2 New Issue
2019-02-25 16:01 jsantos Assigned To => jsantos
2019-02-25 16:01 jsantos Status new => assigned
2019-11-13 11:08 jsantos Priority normal => high