我是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 Image作为renderControl。但它产生的错误无法隐含从Windows.Forms.Control的windows.Controls.Image隐藏。我怎么能转换?有没有其他方式来渲染或创建设备?