SkeletalViewer - 将它带到windows.forms [英] SkeletalViewer - bring it to windows.forms

查看:113
本文介绍了SkeletalViewer - 将它带到windows.forms的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿那里,

我正在寻找一种简单的方法将骨架查看器示例代码传输到windows.forms项目。

I am searching for an easy way to transfer skeletalviewer sample code to a windows.forms project.

 

主要问题是,我没有像"Canvas"这样的元素。或者在骨架查看器中使用的System.Windows.Controls.Image来显示图像。

The main problem is, that I dont have elements like "Canvas" or System.Windows.Controls.Image that are used in skeletal viewer to display the images.

所以知道我在坚持,我不知道如何进一步......

So know I am stucking and I dont have any idea how to get futher...

实际上我编写了一个图像转换器,但我担心帧率和效率!

Actually I coded an image converter but I worry about framerates and efficiency!

 

我知道这看起来有点奇怪,我的问题在这里,但最后一切都会有意义; - )

I know it may seem a bit strange, my whole questions here, but at the end everything will make sense ;-)

 

我正在尝试的是处理kinect多线程的东西。

What I am trying todo is to handle stuff of kinect multithreaded.

我对WPF不太了解(System.Window)或Forms(System.Window.Forms)就是那个东西。可悲的是,我没有时间阅读有关它的书籍。

I dont know much about WPF (System.Window) or Forms (System.Window.Forms) thats the thing. And sadly I dont have the time to read some books about it.

如果我有一个"入口点"在我的Window类中,我可以运行我的"Controller类"在主线程中,在那里创建另一个"WorkerThread"对于视图(MainWindow在骨架查看器样本中调用)....

If I had a "Entry Point" on my Window Class I could run my "Controller class" in main thread and there create another "WorkerThread" for the View (MainWindow called in skeleton viewer sample)....

编辑:一个入口点可以通过:
http://frankmao.com/2009/05/07/control-the-entry -point-of-wpf-application /

Well an entry point could be got through: http://frankmao.com/2009/05/07/control-the-entry-point-of-wpf-application/

但我的视图仍然作为主线程运行。

实际上我想将我的Controller作为主线程运行,然后在新线程中创建其他对象,如kinectmanager或view ...

 

亲切的问候,

Simon

推荐答案

Simon,

Simon,

这个帖子中有很多潜在的问题:)

There are many underlying questions in this thread :)

首先,它是否真的要求你使用windows.forms,即你是否已经拥有一堆带有大量代码的WinForms项目,所以更改它需要比你更多的时间有?

First of all, is it actually a requirement for you to use windows.forms, i.e., do you already have a WinForms project with a bunch of code, so changing it would take more time than you have?

其次,您可以在WinForms或WPF中轻松使用多线程。更一般地,基于多线程UI的应用程序通常在主线程中运行UI并旋转其他线程以进行后台处理。 I.e。:UI线程不是worker
线程。这些线程然后在某些检查点或完成时将数据发送回主线程,并且主UI线程在适当时更新视图(这基本上是Kinect NUI运行时所执行的操作:将"帧就绪"事件发回到主UI
线程,以便UI更新可以在UI线程中完成。

Second, you can use multi-threading just as easily in WinForms or WPF. More generally, a multi-threaded UI-based application typically runs UI in the main thread and spins other threads to do background processing. I.e.: UI thread is not a worker thread. These threads then send data back to main thread at certain checkpoints or when they're done, and the main UI thread updates the view as appropriate (this is basically what the Kinect NUI runtime does: post "frame ready" events back to the main UI thread, so that UI updates can be done in UI thread.

你的"控制器"做什么?它是一种模型 - 视图 - 控制器类型控制器,还是其他类型的?

What does your "Controller" do? Is it a Model-View-Controller kind of controller, or some other kind?

您希望"kinectmanager"做什么?既然您将此kinectmanager与视图相关联,您是否会有不同的独立应用程序窗口彼此沟通对应每个kinectmanager?否则,为什么你
想为每个kinectmanager一个单独的线程?

What would you like your "kinectmanager" to do? Since you associate this kinectmanager with a view, will you have different standalone application windows that don't communicate with one another corresponding to each kinectmanager? Otherwise, why do you want one separate thread for each kinectmanager?

Eddy


这篇关于SkeletalViewer - 将它带到windows.forms的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆