How to embed native control or get native handle of existing control
See original GitHub issueI’m working on video player (GStreamer based) and want to render video inside Avalonia app.
I’m using Panel in WinForms app as video window.
I need some area inside Avalonia window (Panel for example) that can provide native window handle to draw on it. It’s possible for Win32 control or Gtk controls for example.
I can get handle for entire Window but that’s not what I need.
var screenHandle = ((Avalonia.Win32.WindowImpl) ((TopLevel) pnScreen.GetVisualRoot())?.PlatformImpl)?.Handle?.Handle ?? IntPtr.Zero;
As alternative maybe some way to embed native platform controls that have handle into Avalonia window.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Embedding Native (Windows and Linux) Views/Controls ...
This article describes embedding native Windows and Linux control into an Avalonia application.
Read more >Hosting a native control in WPF - c++
I have a native control, written in C++ and using DirectX 11, that I would like to embed within a WPF application. Currently...
Read more >Native embedding - .NET MAUI
Pages, layouts, and views all derive from Element. Native embedding enables any .NET MAUI controls that derive from Element to be consumed in...
Read more >Hosting Native Controls – Moving from Xamarin Forms ...
Learn how to migrate custom renderers from Xamarin Forms to Uno Platform. Explore the process of customizing native platform controls using ...
Read more >Adding an event handler to a native control - ERP 10
You can make event handlers for native controls. Just make sure to do everything the Wizard does. edit. Here's the steps. Declare an...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
0.10 will have an equivalent for HwndHost, see https://github.com/AvaloniaUI/Avalonia/blob/master/samples/interop/NativeEmbedSample/EmbedSample.cs
is it possible to embed SDL2 windows on AvaloniaUI? I did try to do that on WPF with HwndHost, but the BuildWindowCore() throws an InvalidOperationException when returning the HandleRef.