我在VB.NET Windows窗体应用程序中使用ShockwaveFlash ActiveX控件,我想知道.
I'm using the ShockwaveFlash ActiveX control in a VB.NET Windows Forms application and i'm wondering.
是否可以从内存流而不是从文件名将SWF文件加载到ShockwaveFlash ActiveX对象中?
Is it possible to load an SWF file into the ShockwaveFlash ActiveX object from a memory stream rather then from a file name?
我注意到ActiveX对象具有诸如"InlineData"的属性.和"MovieData"和"MovieData",可能使用这些.
I've noticed that the ActiveX object has such properties as "InlineData" and "MovieData", possibly these could be used.
我还注意到有人使用Windows消息系统将指向流的指针发送到ActiveX控件,有人看到了吗?
I've also noticed someone has used Windows Messaging to send a pointer to a stream to the ActiveX control, has anyone seen this done?
致谢
推荐答案
我已经使用Flash组件属性完成了Flash嵌入. 请务必执行以下 1>创建Windows应用程序(默认情况下,"WindowsApplication1" 2>在form1中添加Shockwave Flash组件(AxShockwaveFlash1) 3>将值分配给属性:将SWF文件路径分配给AxShockwaveFlash1的Movie属性(例如C:\ Sample.swf)将EmbedMovie属性设置为true 将FrameNum属性设置为0 4>编译项目这是嵌入了swf的可执行文件,因此现在可以从任何位置运行而无需在硬盘上放松swf文件.我已经检查了Temp文件夹,并且用户数据文件夹,并且该exe文件未提取要播放的swf文件.因此,我认为这很安全.这是执行此示例的代码.
I have done flash embeding using flash component property. it's thoug easy and secured too.tust do the following1>create a windows application (By Default "WindowsApplication1"2>add a shockwave flash component in form1 (AxShockwaveFlash1)3>Assign Values to property: Assign SWF file path to AxShockwaveFlash1's Movie Property (e.g. C:\Sample.swf) Set EmbedMovie Property to true Set FrameNum Property to 04>Compile the projectHere is your Executable ready with embaded swf. so now it can be run from any where without having loose swf file on hard - drive.I have checked Temp folder and also user data folders. and the exe is not extracting swf file to play. so, i thing it is safe. here is the code to do this example.
'''''''''''''''''''''''''''''''''''''''''''''''' ``''''''''''''''''''''''''''''''''<全局. Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ 局部类Form1 继承System.Windows.Forms.Form '处理窗体重写以清理组件列表.< System.Diagnostics.DebuggerNonUserCode()> _ 受保护的替代子Dispose(ByVal以布尔方式进行放置)最后 MyBase.Dispose(dispose) End Try End Sub Windows窗体设计器要求的私有组件作为System.ComponentModel.IContainer '注意:Windows窗体设计器需要执行以下步骤'可以使用Windows窗体设计器对其进行修改. '请勿使用代码编辑器对其进行修改.< System.Diagnostics.DebuggerStepThrough()> _ 私有Sub InitializeComponent()昏暗资源作为System.ComponentModel.ComponentResourceManager =新System.ComponentModel.ComponentResourceManager(GetType(Form1)) Me.AxShockwaveFlash1 =新AxShockwaveFlashObjects.AxShockwaveFlash CType(Me.AxShockwaveFlash1,System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() Enabled = True Me.AxShockwaveFlash1.Location =新System.Drawing.Point(0,0) Me.AxShockwaveFlash1.Name ="AxShockwaveFlash1" Me.AxShockwaveFlash1.OcxState resources.GetObject("AxShockwaveFlash1.OcxState"),System.Windows.Forms.AxHost.State) Me.AxShockwaveFlash1.Size =新System.Drawing.Size(192,192) Me.AxShockwaveFlash1 .TabIndex = 0 Me.AxShockwaveFlash1.Movie ="C:\ Sample.swf" Me.AxShoc kwaveFlash1.EmbedMovie = True Me.AxShockwaveFlash1.FrameNum = 0 ````Form1 ````Me.AutoScaleDimensions =新System.Drawing!F. 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(292,266) Me.Controls.Add(Me .AxShockwaveFlash1) Me.Name ="Form1" Me.Text ="Form1" CType(Me.AxShockwaveFlash1,System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) End Sub 与事件的朋友AxShockwaveFlash1作为AxShockwaveFlashObjects.AxShockwaveFlash 结束类
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _Partial Class Form1 Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1)) Me.AxShockwaveFlash1 = New AxShockwaveFlashObjects.AxShockwaveFlash CType(Me.AxShockwaveFlash1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'AxShockwaveFlash1 ' Me.AxShockwaveFlash1.Enabled = True Me.AxShockwaveFlash1.Location = New System.Drawing.Point(0, 0) Me.AxShockwaveFlash1.Name = "AxShockwaveFlash1" Me.AxShockwaveFlash1.OcxState = CType(resources.GetObject("AxShockwaveFlash1.OcxState"), System.Windows.Forms.AxHost.State) Me.AxShockwaveFlash1.Size = New System.Drawing.Size(192, 192) Me.AxShockwaveFlash1.TabIndex = 0 Me.AxShockwaveFlash1.Movie = "C:\Sample.swf" Me.AxShockwaveFlash1.EmbedMovie = True Me.AxShockwaveFlash1.FrameNum = 0 ' 'Form1 ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(292, 266) Me.Controls.Add(Me.AxShockwaveFlash1) Me.Name = "Form1" Me.Text = "Form1" CType(Me.AxShockwaveFlash1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) End Sub Friend WithEvents AxShockwaveFlash1 As AxShockwaveFlashObjects.AxShockwaveFlashEnd Class
''''''''''''''''''''''''''
'''''''''''''''''''''''''''''
如果有人发现任何泄漏或错误请回复..我认为唯一的问题是swf的大小,但是可以使用split swf并以相同的方式嵌入到不同的dll中来解决.
if anyone find any leak or bug pls respond back..the only issue i think is the size of swf but it can be overcome using split swf and embed in the same way to different dlls.
达米(达维亚)
希望这对您有帮助,只需将其标记为答案
I hope this helps, if that is what you want, just mark it as answer
更多推荐
从内存流加载SWF
发布评论