OpenGL control overlays WPF elements - c#

I have rich client application developed in WPF using DevExpress controls library.
In one of the panels I render some visual elements using OpenTK (OpenGL's wrapper library for .net).
The problem is, OpenGL rendering surface seems to be Top Most within the application. So if I move one panel on to another, OpenGL's control overlays WPF elements:
I'm not sure is it general problem with WPF, or something with DevExpress or OpenTK.
I would like to know, is there anything I can do, to solve this problem?
Edit: I'm using WindowsFormsHost control to put OpenTK's GLControl into WPF UserControl. And I'm using .Net 4.5.

The DockLayoutManager has known limitations when working with WindowsFormsHost. These limitations are general for WPF platform and they are powered by the current implementation of HwndHost (see WPF and Win32 Interoperation MSDN-article for details).
You can try to overcome possible issues with dock panels overlapped by your OpenGL (WinForms) controls, by setting the DockLayoutManager.EnableWin32Compatibility property to true and the DockLayoutManager.FloatingMode property to FloatingMode.Desktop.

Related

Display WPF controls over OpenGL window in Windows desktop application

We're developing Windows desktop app with full-screen OpenGL graphics. Now we want to display a bunch of controls over the OpenGL (arrows, buttons, etc.) It turns out it is very difficult to do that.
The majority of tutorials suggest using WindowsFormsHost for OpenGL rendering, and we did so: http://www.codeproject.com/Articles/23736/Creating-OpenGL-Windows-in-WPF
Unfortunately now we cannot draw WPF controls over WindowsFormsHost, there's a lot of discussion about this all over the internet too: WindowsFormsHost is always the most top from WPF element
Render WPF control on top of WindowsFormsHost
There are some hacks that can work around this, but they all seem very dirty.
Is there a proper way to draw OpenGL directly in WPF without messing with Windows Forms? (I just have no idea why you cannot have this in WPF directly).
In short: is there a known solution for drawing UI over OpenGL in WPF applications?
Create a wpf window.
Render your opengl viewport in background.
Get the Snapshot of the opengl viewport and display the image in the WPF.
Transfer all UI Events on the WPF Image to the opengl viewport.
EDIT:
There is a way to host win32 window inside WPF window.
You can refer this video https://www.youtube.com/watch?v=JO4uW8Xb230.
If you are using GLFW for creating win32 window, you just need to use the underlying handle or just cast the window to HWND that WPF needs to host the window.

Touch capable webbrowser control for WPF

I am having a problem with embedding webbrowser in WPF application.
As you may know the standard webbrowser is not really a WPF component.
When you embed the control you cannot apply any transforms on it and is displayed on the topmost layer as it is just wrapper for winforms control.
I have to create app with webbrowser included; the app should rotate to face all four edges of the touch capable screen that will be built into the restaurant table.
I've tried Awesomium and CefSharp but touch scrolling works only in winforms components (which is weird cause WPF was designed with touch in mind).
Any ideas? Alternative WPF browser components? The component has to WPF control, be touch responsive and preferably free or cheap.
If it is still relevant, there is a way to make WPF WebBrowser control touch-friendly (IE10+), here is how.

Animations for C# .net programming

I am currently working on a project in which I am developing an app with C# .net.
I'm using Visual Studio Ultimate 2010, and I am wondering how I can add some animations and effects to the app?
In my implementation I've enabled moving panels up and down, hiding panels, etc.
My question is, how can I add effects (fading, jQuery-like effects...) to those events?
WinForms is not the idea framework for the effects you have discribed, it is arguably better to change from WInForms to WPF which was designed for these types of effects and 2D/3D rendering.
WPF Graphics and Multimedia
As has been stated, I would look to WPF for these kind of things. If for some reason WPF is not available, you could look to third party libraries for these kind of things, such as Animated Vector Graphics (commercial).

OpenGL with Viewport3D control in WPF

Can Viewport3D control in WPF work with OpenGL?
The WPF's something Viewport3D can't do (there are lots of thing it can't do), whole WPF is DirectX based. This also means DirectX is generally much better supported in WPF.
However you can use OpenTK's WinForms viewport and use WinFormsHost to put it in your application. OpenTK is a very nice .Net wrapper for OpenGL.
However you will not be able to use XAML, bindings and other WPF-specific stuff. You will have to do the OpenGL calls manually from code. All the interop does is that is places the viewport in your application and lets you do .Net calls on it.
You may also want to have a look at this project.
It cannot, in the sense that you can merge 3D content from OpenGL to Viewport3D seemlessly (with correct Z testing and all).

Simple animation library for a bit of flash

I have a C# winforms project and I want to add a bit of jQuery or iPhone style animation flash to it.
Nothing too fancy just an easy way to slide and expand panels, perhaps a bit of rotation.
Is there a library out there that would do this all for me?
You can also inject WPF controls into your WinForms apps if you're wanting to add stuff in to an existing project. Here's a good tutorial on how it's done.
I'm not sure if it would work for drawing 3D or rotating (although it might), but you can def use WPF in your WinForms. I haven't tried using the expander myself, but other controls I've used worked just fine.
If you're using .NET 3.5 you can use WPF to achieve animations.

Categories

Resources