helix-toolkit | Helix Toolkit is a collection of 3D components for .NET
kandi X-RAY | helix-toolkit Summary
kandi X-RAY | helix-toolkit Summary
HelixToolkit.WPF: Adds variety of functionalities/models on the top of internal WPF 3D models (Media3D namespace). HelixToolkit.Core.WPF: Adds variety of functionalities/models on the top of internal .NET Core WPF 3D models (Media3D namespace). HelixToolkit.SharpDX.WPF: Custom 3D Engine and XAML/MVVM compatible Scene Graphs based on SharpDX(DirectX 11) for high performance usage. HelixToolkit.UWP: Custom 3D Engine and XAML/MVVM compatible Scene Graphs based on SharpDX(DirectX 11) for Universal Windows App. HelixToolkit.SharpDX.Core: Custom 3D Engine and Scene Graphs based on SharpDX(DirectX 11) for netstandard and .NET Core. HelixToolkit.SharpDX.Core.Wpf: Wpf Wrapper Components based on HelixToolkit.SharpDX.Core for .NET Core Wpf. HelixToolkit.WinUI: Custom 3D Engine and XAML/MVVM compatible Scene Graphs based on SharpDX(DirectX 11) for WinUI 3 (Project Reunion - experimental). HelixToolkit.SharpDX.Assimp: Assimp.Net 3D model importer/expoter support for HelixToolkit.SharpDX Components. Examples: Please download full source code to run examples. Or download compiled version.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of helix-toolkit
helix-toolkit Key Features
helix-toolkit Examples and Code Snippets
Community Discussions
Trending Discussions on helix-toolkit
QUESTION
I'm trying to take a screenshot of user control (viewport) in WPF application. My problem is that I don't know how to get the position of window or viewport while staying in accord with MVVM pattern.
Here is the method, but it takes all the screen instead of my viewport, since I don't know how to bind window/viewport properties to it.
...ANSWER
Answered 2021-Jan-07 at 12:24Trick with CommandParameter can let you pass some FrameworkElement to your command placed in your ViewModel. My example
xaml (you can refine if you need only your control in CommandParameter)
QUESTION
C#, WPF, Helix Toolkit. I am trying to save an image from a HelixViewport3D
viewport (as described here) and am still having problems.
Intended method: Render image to viewport and simply save that using Viewport3DHelper.SaveBitmap()
or similar method.
ANSWER
Answered 2020-Aug-18 at 13:03I got an answer to this here:
Asynchronous operations within a loop - how to keep control of execution?
There doesn't seem to be a completion event available, so the only way around it that I have been able to find is to use async
.
QUESTION
Follow-on question to this one.
I am trying to generate and save a series of images. Rendering is done by Helix Toolkit, which I am told utilises the WPF composite render thread. This is causing problems because it executes asynchronously.
My original problem was that I couldn't save a given image because it hadn't yet been rendered at that time I was trying to save it. The above answer provides a workaround to this by putting the 'save' operation inside an Action
which is called with low priority, thus ensuring that the rendering completes first.
This is fine for one image, but in my application I require multiple images. As it stands I cannot keep control of the sequence of events because they occur asynchronously. I am using a For
loop which just continues regardless of the progress of rendering and saving the images. I need the images to be generated one by one, with enough time for rendering and saving before starting the next one.
I have tried putting delays in the loop but that causes its own problems. For instance an async await
as commented in the code causes cross-threading issues because the data was created on a different thread from where the rendering is being done. I tried putting in a simple delay but then that just locks everything up - I think in part because the save operation I am waiting on has very low priority.
I cannot simply treat it as a batch of separate unrelated asynchronous tasks because I am using a single HelixViewport3D
control in the GUI. The images have to be generated sequentially.
I did try a recursive method where SaveHelixPlotAsBitmap()
calls DrawStuff()
but that wasn't working out very well, and it doesn't seem a good approach.
I tried setting a flag ('busy') on each loop and waiting for it to be reset before continuing but that wasn't working - again, because of the asynchronous execution. Similarly I tried using a counter to keep the loop in step with the number of images that had been generated but ran into similar problems.
I seem to be going down a rabbit hole of threading and asynchronous operations that I don't want to be in.
How can I resolve this?
...ANSWER
Answered 2020-Aug-15 at 13:51Note These examples are just to prove a concept, there is work needed on the TaskCompletionSource to handle errors
Given this test window
QUESTION
C#, WPF, Helix Toolkit. I am trying to generate a bitmap from a HelixViewport3D
and have encountered a few problems.
The first problem is that I cannot find a way to render off-screen. There are a few references to this online (e.g. here) and as far as I can see it does not have a built-in solution.
As a somewhat sub-optimal workaround I have proceeded to render to the screen where the user can see it, with the intention of creating a bitmap from that rendered image. I now have the problem that an image exported from the content on screen (e.g. using Viewport3DHelper.SaveBitmap
) is blank if I call it immediately. I understand that this is because Helix Toolkit is rendering the image in the WPF composite render thread, so there is no image to grab at the time I try to grab it, because it has not yet been rendered.
I am not aware of a 'render complete' event that I can subscribe to. Is there one?
If not, would a workaround perhaps be to use thread priorities in order to make my code lower priority, so that it waits for the rendering to complete before continuing?
...ANSWER
Answered 2020-Aug-13 at 18:06I managed to find a solution thanks to this answer:
Dispatcher.BeginInvoke(new Action(() => DoSomething()), DispatcherPriority.ContextIdle, null);
The Action will be called once the rendering is done.
So in your case you could use it like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install helix-toolkit
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page