Reputation: 767
Is it possible to have a code (server and all that) in Winform and then instead of setting an image to a panel/picturebox, i can set it to WPF (which is faster?).
If so, will this operation be fast, or will it have to invoke or something which causes some delay in it?
I have tried doing this, settings an image on WPF from winform, sadly it wasn´t as easy as i expected.
Upvotes: 0
Views: 311
Reputation: 208
Sounds like you want a WindowsFormHost It allows you to utilize WinForm controls in a WPF application. It still renders through GDI though. If you want it to utilize WPF, you could pass the data you use to render the image up to WPF.
Upvotes: 1
Reputation: 8708
I had a Windows Forms project and was able to : create new WPF pages : add WPF controls to existing Windows Forms
First of all you need to change you .csproj in order to have the option of creating a new WPF page and control available. I do not know now by heart, but basically it's a GUID you add.
From what i read you want the second. While on the Windows Forms designer you can just go to you toolbox and drop a WPF control into the Windows Forms. By doing so VS creates to things: 1. Your wpf control 2. ElementHost control
You can then access your wpf control just as usual by accessing its variable name.
Upvotes: 2