Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Can';t在WPF中将System.windows.Controls.Image隐式转换为System.windows.form.control_C#_Wpf - Fatal编程技术网

C# Can';t在WPF中将System.windows.Controls.Image隐式转换为System.windows.form.control

C# Can';t在WPF中将System.windows.Controls.Image隐式转换为System.windows.form.control,c#,wpf,C#,Wpf,我对WPF完全陌生。我正在将应用程序从windows窗体应用程序转换为WPF应用程序。windows窗体应用程序工作正常。我必须创建一个用于渲染图像的设备。为此,我使用了以下代码。 //定义渲染控件 private System.Windows.Forms.Control renderControl; //get and set rendercontrol public System.Windows.Forms.Control RenderControl { get {

我对WPF完全陌生。我正在将应用程序从windows窗体应用程序转换为WPF应用程序。windows窗体应用程序工作正常。我必须创建一个用于渲染图像的设备。为此,我使用了以下代码。 //定义渲染控件

private System.Windows.Forms.Control renderControl;

//get and set rendercontrol

public System.Windows.Forms.Control RenderControl

  {

       get { return renderControl; }
    set { renderControl = value;  }
    }

//PresentParameters

pp = new PresentParameters();

pp.Windowed = true;

pp.SwapEffect = SwapEffect.Discard;

    device = new Microsoft.DirectX.Direct3D.Device(0, Microsoft.DirectX.Direct3D.DeviceType.Hardware, renderControl, CreateFlags.SoftwareVertexProcessing, pp);

我导入这个类并使用WPF图像作为renderControl。但它生成的错误不能隐式地从windows.Controls.Image转换为windows.Forms.Control。我怎样才能转化?是否有其他方式来呈现或创建设备?

WPF控件与Windows窗体控件不兼容或不可互换。在WPF中承载Direct3D曲面的最佳方法是使用