DirectX renderer .net6 port in WPF

%3CLINGO-SUB%20id%3D%22lingo-sub-3128624%22%20slang%3D%22en-US%22%3EDirectX%20renderer%20.net6%20port%20in%20WPF%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3128624%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EI%20am%20porting%20a%20directx%20renderer%20to%20.net6%20from%20.net%20framework%204.8.%26nbsp%3BPreviously%20we%20could%20use%20D3DImage%20and%20draw%20to%20that%20in%20a%20wpf%20window.%20Now%20since%20its%20missing%2C%20i%20manage%20to%20draw%20using%20the%20window%20handle%20but%20now%20problem%20comes%20are%20GUI%20buttons%2C%20it%20draws%20on%20whole%20screen%20since%20parent%20window%20handle%20and%20handle%20for%20control%20are%20same.%26nbsp%3B%3CSPAN%3EIn%20winforms%20for%20example%20if%20i%20use%20splitview%20and%20render%20on%20right%20side%2C%20window%20handle%20of%20left%20and%20right%20is%20different%20and%20i%20can%20render%20there%20without%20issues.%20I%20also%20tried%20making%20a%20separate%20child%20window%20in%20wpf%20and%20then%20it%20works%20fine%20since%20the%20handle%20is%20different%20but%20having%20gui%20in%20one%20window%20and%20rendering%20in%20another%20is%20not%20really%20a%20good%20solution.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EIs%20there%20a%20way%20to%20make%20child%20window%20inside%20main%20window%20in%20wpf%20in%20.net6%20%3F%3F%20or%20any%20other%20way%20to%20tackle%20this%20problem%20%3F%3C%2FP%3E%3CP%3EAny%20help%20or%20tips%20will%20be%20appreciated.%20Thanks!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3128624%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EWPF%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Visitor

Hi,

I am porting a directx renderer to .net6 from .net framework 4.8. Previously we could use D3DImage and draw to that in a wpf window. Now since its missing, i manage to draw using the window handle but now problem comes are GUI buttons, it draws on whole screen since parent window handle and handle for control are same. In winforms for example if i use splitview and render on right side, window handle of left and right is different and i can render there without issues. I also tried making a separate child window in wpf and then it works fine since the handle is different but having gui in one window and rendering in another is not really a good solution.

Is there a way to make child window inside main window in wpf in .net6 ?? or any other way to tackle this problem ?

Any help or tips will be appreciated. Thanks!

0 Replies