:
The sample source codes on this page will demonstrate you how to make SWF to WMV with live preview in VB.NET. SWF to WMV with live preview in VB.NET can be implemented with ByteScout SWF To Video SDK. ByteScout SWF To Video SDK is the library that can take SWF (Flash Macromedia) files and convert into WMV or AVI video with sound. Dynamic flash movie scenes, variables, actionscripts are supported and you also may adjust output video size, framerate and quality.
The SDK samples like this one below explain how to quickly make your application do SWF to WMV with live preview in VB.NET with the help of ByteScout SWF To Video SDK. To do SWF to WMV with live preview in your VB.NET project or application you may simply copy & paste the code and then run your app! Code testing will allow the function to be tested and work properly with your data.
Our website provides free trial version of ByteScout SWF To Video SDK. It comes along with all these source code samples with the goal to help you with your VB.NET application implementation.
On-demand (REST Web API) version:
Web API (on-demand version)
On-premise offline SDK for Windows:
60 Day Free Trial (on-premise)
Partial Class Form1
''' <summary>
''' Required designer variable.
''' </summary>
Private components As System.ComponentModel.IContainer = Nothing
''' <summary>
''' Clean up any resources being used.
''' </summary>
''' <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
Protected Overloads Overrides Sub Dispose(disposing As Boolean)
If disposing AndAlso (components IsNot Nothing) Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
#Region "Windows Form Designer generated code"
''' <summary>
''' Required method for Designer support - do not modify
''' the contents of this method with the code editor.
''' </summary>
Private Sub InitializeComponent()
Me.buttonConvert = New System.Windows.Forms.Button
Me.pictureBox1 = New System.Windows.Forms.PictureBox
Me.label1 = New System.Windows.Forms.Label
CType(Me.pictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'buttonConvert
'
Me.buttonConvert.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.buttonConvert.Location = New System.Drawing.Point(18, 227)
Me.buttonConvert.Name = "buttonConvert"
Me.buttonConvert.Size = New System.Drawing.Size(254, 23)
Me.buttonConvert.TabIndex = 0
Me.buttonConvert.Text = "Convert test.swf with conversion preview"
Me.buttonConvert.UseVisualStyleBackColor = True
'
'pictureBox1
'
Me.pictureBox1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.pictureBox1.Location = New System.Drawing.Point(18, 31)
Me.pictureBox1.Name = "pictureBox1"
Me.pictureBox1.Size = New System.Drawing.Size(254, 180)
Me.pictureBox1.TabIndex = 1
Me.pictureBox1.TabStop = False
'
'label1
'
Me.label1.AutoSize = True
Me.label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(204, Byte))
Me.label1.Location = New System.Drawing.Point(15, 9)
Me.label1.Name = "label1"
Me.label1.Size = New System.Drawing.Size(122, 13)
Me.label1.TabIndex = 2
Me.label1.Text = "Conversion preview:"
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(284, 262)
Me.Controls.Add(Me.label1)
Me.Controls.Add(Me.pictureBox1)
Me.Controls.Add(Me.buttonConvert)
Me.Name = "Form1"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Form1"
CType(Me.pictureBox1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
#End Region
Private WithEvents buttonConvert As System.Windows.Forms.Button
Private pictureBox1 As System.Windows.Forms.PictureBox
Private label1 As System.Windows.Forms.Label
End Class
60 Day Free Trial or Visit ByteScout SWF To Video SDK Home Page
Explore ByteScout SWF To Video SDK Documentation
Explore Samples
Sign Up for ByteScout SWF To Video SDK Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
Imports System.Drawing
Imports System.Windows.Forms
Imports BytescoutSWFToVideo
Public Partial Class Form1
Inherits Form
Private m_g As Graphics
Private m_hdc As IntPtr
Private swf As New SWFToVideoClass()
Public Sub New()
InitializeComponent()
End Sub
Private Sub buttonConvert_Click(ByVal sender As Object, ByVal e As EventArgs) Handles buttonConvert.Click
If Not swf.IsRunning Then
swf.SWFConversionMode = SWFConversionModeType.SWFWithLiveData
swf.ConversionTimeOut = 15000
swf.InputSWFFileName = "test.swf"
swf.OutputVideoFileName = "test.wmv"
swf.OutputWidth = 640
swf.OutputHeight = 480
swf.SetPreviewContext(m_hdc.ToInt32(), 0, 0, pictureBox1.Width, pictureBox1.Height, 30)
swf.Run()
End If
End Sub
Private Sub Form1_Shown(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Shown
m_g = pictureBox1.CreateGraphics()
m_hdc = m_g.GetHdc()
End Sub
Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As FormClosedEventArgs) Handles MyBase.FormClosed
m_g.ReleaseHdc(m_hdc)
m_g.Dispose()
' release resources
System.Runtime.InteropServices.Marshal.ReleaseComObject(swf)
swf = Nothing
End Sub
End Class
60 Day Free Trial or Visit ByteScout SWF To Video SDK Home Page
Explore ByteScout SWF To Video SDK Documentation
Explore Samples
Sign Up for ByteScout SWF To Video SDK Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
' x64 IMPORTANT NOTE: set CPU to x86 to build in x86 mode. WHY? Because flash is not supported on x64 platform currently at all
Imports System.Collections.Generic
Imports System.Windows.Forms
NotInheritable Class Program
Private Sub New()
End Sub
''' <summary>
''' The main entry point for the application.
''' </summary>
<STAThread> _
Friend Shared Sub Main()
Application.EnableVisualStyles()
Application.SetCompatibleTextRenderingDefault(False)
Application.Run(New Form1())
End Sub
End Class
60 Day Free Trial or Visit ByteScout SWF To Video SDK Home Page
Explore ByteScout SWF To Video SDK Documentation
Explore Samples
Sign Up for ByteScout SWF To Video SDK Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
60 Day Free Trial or Visit ByteScout SWF To Video SDK Home Page
Explore ByteScout SWF To Video SDK Documentation
Explore Samples
Sign Up for ByteScout SWF To Video SDK Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples