tkawa
Topic Author
Posts: 18
Joined: 07 Nov 2018, 05:34

Optimizing Performance: 2D Graphics and Imaging

23 Aug 2019, 07:14

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.
 
User avatar
sfernandez
Site Admin
Posts: 2991
Joined: 22 Dec 2011, 19:20

Re: Optimizing Performance: 2D Graphics and Imaging

26 Aug 2019, 11:37

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.
 
tkawa
Topic Author
Posts: 18
Joined: 07 Nov 2018, 05:34

Re: Optimizing Performance: 2D Graphics and Imaging

26 Aug 2019, 13:37

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.

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 8 guests