在 C# WinForms 应用程序中显示 Flash 内容

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1037/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-07-31 12:09:56  来源:igfitidea点击:

Displaying Flash content in a C# WinForms application

提问by FryHard

What is the best way to display Flashcontent in a C#WinForms application? I would like to create a user control (similar to the current PictureBox) that will be able to display images and flash content.

FlashC#WinForms 应用程序中显示内容的最佳方式是什么?我想创建一个PictureBox能够显示图像和 Flash 内容的用户控件(类似于当前的)。

It would be great to be able to load the flash content from a streamof sorts rather than a file on disk.

能够从各种而不是磁盘上的文件加载闪存内容会很棒。

采纳答案by sven

While I haven't used a flash object inside a windows form application myself, I do know that it's possible. In Visual studio on your toolbox, choose to add a new component. Then in the new window that appears choose the "COM Components"tab to get a list in which you can find the "Shockwave Flash Object"

虽然我自己没有在 Windows 窗体应用程序中使用过 flash 对象,但我知道这是可能的。在工具箱上的 Visual Studio 中,选择添加新组件。然后在出现的新窗口中选择“COM组件”选项卡以获取一个列表,您可以在其中找到“Shockwave Flash Object”

Once added to the toolbox, simply use the control as you would use any other "standard" control from visual studio.

添加到工具箱后,只需像使用 Visual Studio 中的任何其他“标准”控件一样使用该控件。

three simple commands are available to interact with the control:

三个简单的命令可用于与控件交互:

  • AxShockwaveFlash1.Stop()
  • AxShockwaveFlash1.Movie = FilePath & "\FileName.swf"
  • AxShockwaveFlash1.Play()
  • AxShockwaveFlash1.Stop()
  • AxShockwaveFlash1.Movie = 文件路径 & "\FileName.swf"
  • AxShockwaveFlash1.Play()

which, I think, are all self explanatory.

我认为,这都是不言自明的。

It would be great to be able to load the flash content from a stream of sorts rather than a file on disk.

能够从各种流而不是磁盘上的文件加载闪存内容会很棒。

I just saw you are also looking for a means to load the content from a stream, and because I'm not really sure that is possible with the shockwave flash object I will give you another option (two actually).

我刚刚看到您也在寻找一种从流中加载内容的方法,因为我不确定使用冲击波 Flash 对象是否可行,所以我会给您另一种选择(实际上有两个)。

the first is the one I would advise you to use only when necessary, as it uses the full blown "webbrowser component"(also available as an extra toolbox item), which is like trying to shoot a fly with a bazooka. of course it will work, as the control will act as a real browser window(actually the internet explorer browser), but its not really meant to be used in the way you need it.

第一个是我建议您仅在必要时使用的一个,因为它使用完整的“网络浏览器组件”(也可作为额外的工具箱项目提供),就像尝试用火箭筒射击苍蝇一样。当然它会起作用,因为该控件将充当一个真正的浏览器窗口(实际上是 Internet Explorer 浏览器),但它并不真正意味着以您需要的方式使用它。

the second option is to use something I just discovered while looking for more information about playing flash content inside a windows form. F-IN-BOXis a commercial solution that will also play content from a given website URL. (The link provided will direct you to the .NET code you have to use).

第二个选项是使用我刚刚在寻找有关在 Windows 窗体中播放 Flash 内容的更多信息时发现的内容。F-IN-BOX是一种商业解决方案,它也可以播放来自给定网站 URL 的内容。(提供的链接将引导您到您必须使用的 .NET 代码)。

回答by FryHard

Sven, you reached the same conclusion as I did: I found the Shockwave Flash Object, all be it from a slightly different route, but was stumped on how to load the files from somewhere other than file on disk/URL. The F-IN-BOX, although just a wrapper of the Shockwave Flash Object seems to provide much more functionality, which may just help me!

Sven,你得出了和我一样的结论:我找到了 Shockwave Flash Object,所有的路径都略有不同,但对如何从磁盘/URL 上的文件以外的其他地方加载文件感到困惑。在F-IN-BOX,虽然只是一个的Shockwave Flash Object的包装似乎提供了更多的功能,这样会帮助我!

Shooting flys with bazookas may be fun, but an embeded web brower is not the path that I am looking for. :)

用火箭筒射击苍蝇可能很有趣,但嵌入式网络浏览器不是我正在寻找的途径。:)

There was a link on Adobe's site that talked about "Embedding and Communicating with the Macromedia Flash Player in C# Windows Applications" but they seem to have removed it :(

Adobe 网站上有一个链接,其中提到了“在 C# Windows 应用程序中嵌入和与 Macromedia Flash Player 通信”,但他们似乎已将其删除:(