我有一个swf对象,我想使用COM Shockwave Flash对象控件嵌入它。我已经搜索过了,但我只找到了使用文件或互联网URL的答案。由于我使用的是一键发布方法,我希望有一种方法将我的flash对象作为资源文件嵌入到我的应用程序中。
谢谢,
哑光
发布于 2012-08-01 11:05:05
我过去做过类似的事情,但是从DB表而不是资源加载
Swf是表单上显示闪存项的AxShockwaveFlash对象。
如果将资源添加为.swf,并将FileType设置为二进制,则应将其作为字节数组返回,然后可以在内存流构造函数中使用。
Using ms As New IO.MemoryStream(my.resources.TheFlashFile), fs As New IO.MemoryStream()
Using bwriter As New IO.BinaryWriter(fs)
' Write length of stream for flash AxHost.State
bwriter.Write(8 + ms.ToArray.Length)
bwriter.Write(&H55665566)
' Length of flash movie file
bwriter.Write(ms.ToArray.Length)
bwriter.Write(ms.ToArray)
fs.Seek(0, IO.SeekOrigin.Begin)
swf.OcxState = New AxHost.State(fs, 1, False, Nothing)
End Using
End Usinghttps://stackoverflow.com/questions/11757620
复制相似问题