Active X控件JavaScript [英] Active X Control JavaScript

查看:95
本文介绍了Active X控件JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我和我的同事遇到了一个令人讨厌的情况,我们必须使用活动的X控件来操纵页面上的网络摄像头。

My coworker and I have encountered a nasty situation where we have to use an active X control to manipulate a web camera on a page.

是否可以将JavaScript事件处理程序分配给活动x控件中的按钮,以便在单击时在页面上触发操作,还是必须在html页面本身上创建一个按钮来操纵Active X控件,然后可以在该页面上触发任何必要的操作?

Is it possible to assign a javascript event handler to a button in the active x control so that it would fire an action on the page when clicked, or do we have to create a button on the html page itself that manipulates the Active X Control and then can fire any necessary actions on the page?

推荐答案

请仅使用现有的ActiveX控件。像Flash或Silverlight。 Flash具有内置的网络摄像头支持,并且可以通过JavaScript进行控制。 Silverlight没有内置的摄像头支持,但是它的JavaScript集成非常棒。

Please just use an existing ActiveX control. Like Flash or Silverlight. Flash has built-in webcam support and is controllable via JavaScript. Silverlight doesn't have built-in camera support, but it's JavaScript integration is fantastic.

如果您必须自己编写,然后不用烦恼,那么将其移植到您就很简单了。与JavaScript进行交互。您只需要公开 IDispatch 界面。

If you must write your own then fret not, it is trivial to get it to interact with JavaScript. You just have to expose the IDispatch interface.

对于事件,您需要了解连接点

For events, you need to learn about Connection Points.

这篇关于Active X控件JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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