Here is the code for creating .FLV file from SWF
Here i am getting .flv file which is of no any data into that.
Please reply me,
Private
Shared Sub AddImageWithoutBorders()
Dim flash As New Swf.FlashContainer()
'set frame rate
flash.FrameRate = 12.0F
'set frame size
flash.FrameSize = New Basic.Rect(0, 0, 11000, 8000)
'Add the background colour
flash.Add(New Swf.SetBackgroundColor(New Basic.RGB(255, 255, 255, 255)))
'Add the image without borders
'Get all the objects needed for adding image in swf file
Dim flashObjs1 As ArrayList = AddImage(flash.NewIdentifier(), flash.NewIdentifier(), "d:\kishan\TestAspose\Bluehills.jpg", 500, 500, 5000, _
3000)
Dim flashObjs2 As ArrayList = AddImage(flash.NewIdentifier(), flash.NewIdentifier(), "d:\kishan\TestAspose\sunset.jpg", 500, 500, 5000, _
3000)
Dim flashObjs3 As ArrayList = AddImage(flash.NewIdentifier(), flash.NewIdentifier(), "d:\kishan\TestAspose\Winter.jpg", 500, 500, 5000, _
3000)
flash.Add(flashObjs2)
'flash.Write("d:\kishan\TestAspose\out.swf")
' Open output file stream
Dim fileStream As IO.Stream = New IO.FileStream("d:\kishan\TestAspose\movie.flv", FileMode.Create)
' Create FLV packer
Dim packer As IPacker = New FLVPacker(fileStream)
' Created FLV movie and write it to the stream
packer.Pack(flash)
' Close stream
fileStream.Flush()
fileStream.Close()
End Sub
Private Shared Function AddImage(ByVal imgID As Integer, ByVal shpID As Integer, ByVal imageFile As String, ByVal X As Integer, ByVal Y As Integer, ByVal Width As Integer, _
ByVal Height As Integer) As ArrayList
Dim flashObjs As New ArrayList()
Dim bmp As New Bitmaps.FlashBitmap(imgID, FlashBitmapType.FlashBitmapJpeg, False, imageFile)
flashObjs.Add(bmp)
'Calculate scaling factor
Dim scaleX As Double = CDbl(Width) / CDbl(bmp.Width)
Dim scaleY As Double = CDbl(Height) / CDbl(bmp.Height)
'Create a rectangle shape with image as a fill via ShapeManager
Dim shapeManager As New Shapes.ShapeManager()
shapeManager.Add(New Shapes.SolidLine(1, New Basic.RGB(255, 0, 0, 255)))
shapeManager.Add(New Shapes.BitmapFill(FillStyleType.NonSmoothedClippedBitmap, imgID, New Basic.MatrixTransform(X, Y, scaleX, scaleY)))
shapeManager.DrawRectangle(X, Y, Width, Height)
'Add the shape and place it on display list
Dim defshp As Shapes.DefineShape2 = shapeManager.GetDefineShape(shpID)
Dim scr As Shapes.StyleChangeRecord = TryCast(defshp.Shape.ShapeList(0), Shapes.StyleChangeRecord)
scr.LineStyle = -2147483648
flashObjs.Add(defshp)
flashObjs.Add(New Swf.PlaceObject2(shpID, 1, 0, 0))
Return flashObjs
End Function