Page 1 of 1

Optimizing Performance: 2D Graphics and Imaging

Posted: 23 Aug 2019, 07:14
by tkawa
I'd like to optimize performance about image drawing.
In WPF, I heard that Drawing objects are simpler constructs than Shape objects and provide better performance characteristics.
https://docs.microsoft.com/en-us/dotnet ... and_Shapes

But, those Drawing objects(GeometryDrawing, DrawingGroup, etc.) are not supported in Noesis, right?
<Image>
    <Image.Source>
        <DrawingImage>
            <DrawingImage.Drawing>
                <GeometryDrawing>
                    <GeometryDrawing.Geometry>
                        <GeometryGroup>
                            <EllipseGeometry Center="50,50" RadiusX="45" RadiusY="20" />
                        </GeometryGroup>
                    </GeometryDrawing.Geometry>
                    <GeometryDrawing.Pen>
                        <Pen Thickness="10" Brush="Black" />
                    </GeometryDrawing.Pen>
                </GeometryDrawing>
            </DrawingImage.Drawing>
        </DrawingImage>
    </Image.Source>
</Image>
Please let me know if there is any other way.

Re: Optimizing Performance: 2D Graphics and Imaging

Posted: 26 Aug 2019, 11:37
by sfernandez
Drawing objects are not implemented yet in Noesis, could you please add a feature request in our bugtracker?

Anyway using an Image to render a Drawing would require to create an intermediate texture, so at the end it will perform worse than directly rendering Paths to the screen.
The fastest way to render 2D geometry would be to inherit from FrameworkElement and override the OnRender() method. This way you can draw different geometries with their own brushes and pens with a single UI element in the tree.

Re: Optimizing Performance: 2D Graphics and Imaging

Posted: 26 Aug 2019, 13:37
by tkawa
Thank you.
I requested here: https://www.noesisengine.com/bugs/view.php?id=1547
The fastest way to render 2D geometry would be to inherit from FrameworkElement and override the OnRender() method.
I see it. I try the way if really need it.