|
|||
|
I have 112 jpeg files in a folder and I want to make an swf out of them.
I've got code that works and I figured out how to do it without crashing, but I'm wondering why the previous code that I had did not work. Basically, it seems that if I don't keep a reference to each Bitmap and Input object that is added to the movie, when I save the movie it crashes. Here is the code that works (I have an array of 112 inputs and Bitmaps): Code:
Private Sub jpg2swf2()
Dim oMov As MINGXLib.Movie: Set oMov = New MINGXLib.Movie
Dim aInput(1 To 112) As MINGXLib.input
Dim aFrame(1 To 112) As MINGXLib.Bitmap
Dim i&
With oMov
.Create
.SetDimension 800, 600
.SetRate 4
For i = 1 To 112
Set aInput(i) = New MINGXLib.input
Set aFrame(i) = New MINGXLib.Bitmap
aInput(i).Create "C:\Temp\1 jpg\vnc" & i & ".jpg"
aFrame(i).Create aInput(i)
.Add aFrame(i)
.NextFrame
Next
End With
oMov.Save "C:\Temp\1 jpg\vnc.swf"
End Sub
Code:
Private Sub jpg2swf()
Dim oMov As MINGXLib.Movie
Set oMov = New MINGXLib.Movie
Dim oFrame As MINGXLib.Bitmap
Dim i&
With oMov
.Create
.SetDimension 800, 600
.SetRate 4
For i = 1 To 112
FrameLoad "C:\Temp\1 jpg\vnc" & i & ".jpg", oFrame
.Add oFrame
.NextFrame
Next
End With
oMov.Save "C:\Temp\1 jpg\vnc.swf" ' Crash happens here.
End Sub
Private Sub FrameLoad(sFile As String, oFrame As MINGXLib.Bitmap)
Dim oInput As MINGXLib.input
Set oInput = New MINGXLib.input
Set oFrame = New MINGXLib.Bitmap
oInput.Create sFile
oFrame.Create oInput
End Sub
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|