1

我有一个正在与 C# 应用程序交互的摄像机。相机实际上带有一个 .NET WinForms 控件。它支持使用 GDI+ 功能在其上绘图。

当我放大时,我需要<1 像素精度,即我想绘制一个半径小于两个像素的圆。如何在 WinForms 中绘制矢量图形?我最好的选择是覆盖 WPF 画布吗?我知道我可以在 WinForm 应用程序中使用 WPF 控件,但是是否可以使 ElementHost/WPF 画布的背景透明并将其覆盖到我的视频源上?我最好创建一个 WPF 应用程序,并且只在 WindowsFormsHost 提供程序上使用这个视频控件吗?

在 C# 应用程序中绘制矢量图形的任何其他解决方案?

提前致谢。

4

1 回答 1

4

Well, unfortunately you won't be able to use WPF to overlay anything on your WinForms control due to airspace issues. Winforms and WPF content is not allowed to overlap inside the same window. You're stuck using vanilla GDI or another custom Winforms vector library.

MSDN Link to explanation of interoperability issues.

于 2009-11-20T16:37:32.797 回答