ByteScout SWF To Video SDK - VB.NET - Conversion Progress GUI - ByteScout

ByteScout SWF To Video SDK – VB.NET – Conversion Progress GUI

  • Home
  • /
  • Articles
  • /
  • ByteScout SWF To Video SDK – VB.NET – Conversion Progress GUI

conversion progress GUI in VB.NET using ByteScout SWF To Video SDK

conversion progress GUI in VB.NET

Today you are going to learn how to conversion progress GUI in VB.NET. ByteScout SWF To Video SDK helps with conversion progress GUI in VB.NET. 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 conversion progress GUI in VB.NET with the help of ByteScout SWF To Video SDK. This VB.NET sample code should be copied and pasted into your application’s code editor. Then just compile and run it to see how it works. Enhanced documentation and tutorials are available along with installed ByteScout SWF To Video SDK if you’d like to dive deeper into the topic and the details of the API.

ByteScout SWF To Video SDK is available as free trial. You may get it from our website along with all other source code samples for VB.NET applications.

Try ByteScout SWF To Video SDK today: Get 60 Day Free Trial or sign up for Web API

Form1.Designer.vb
      
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.label1 = New System.Windows.Forms.Label() Me.progressBar1 = New System.Windows.Forms.ProgressBar() Me.SuspendLayout() ' ' buttonConvert ' Me.buttonConvert.Location = New System.Drawing.Point(18, 67) 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 AddHandler Me.buttonConvert.Click, New System.EventHandler(AddressOf Me.buttonConvert_Click) ' ' label1 ' Me.label1.AutoSize = True Me.label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CByte(204)) Me.label1.Location = New System.Drawing.Point(15, 9) Me.label1.Name = "label1" Me.label1.Size = New System.Drawing.Size(126, 13) Me.label1.TabIndex = 2 Me.label1.Text = "Conversion progress:" ' ' progressBar1 ' Me.progressBar1.Location = New System.Drawing.Point(18, 28) Me.progressBar1.Name = "progressBar1" Me.progressBar1.Size = New System.Drawing.Size(254, 23) Me.progressBar1.TabIndex = 3 ' ' Form1 ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(284, 102) Me.Controls.Add(Me.progressBar1) Me.Controls.Add(Me.label1) Me.Controls.Add(Me.buttonConvert) Me.Name = "Form1" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Form1" Me.ResumeLayout(False) Me.PerformLayout() End Sub #End Region Private buttonConvert As System.Windows.Forms.Button Private label1 As System.Windows.Forms.Label Private progressBar1 As System.Windows.Forms.ProgressBar End Class

Try ByteScout SWF To Video SDK today: 60 Day Free Trial (on-premise version) or sign up for Web API (on demand version)

Form1.vb
      
Imports System.Windows.Forms Imports BytescoutSWFToVideo Public Partial Class Form1 Inherits Form Public Const WM_APP As Integer = &H8000 Public Const WM_CONVERSION_PROGRESS As Integer = WM_APP + 1 Private swf As New SWFToVideoClass() Public Sub New() InitializeComponent() End Sub Private Sub buttonConvert_Click(sender As Object, e As EventArgs) If Not swf.IsRunning Then swf.SWFConversionMode = SWFConversionModeType.SWFAnimation swf.ConversionTimeOut = 5000 ' you may calculate output video duration using information about the the source swf movie ' WARNING #1: this method to calculate the output video duration is not working for movies with dynamic scenes ' and interactive scripts as in these movies it is not possible to calculate the precise duration of the movie ' WARNING #2: you should set the input swf or flv filename (or url) before this calculation ' So the movie duration is calculated as the following: ' as swf frame count (number of frames in the swf) / movieFPS (frames per second defined in swf) ' and then multiplied by 1000 (as we are setting the .ConverstionTimeout in milliseconds) ' as the following (uncomment if you want to set the length of the output video to the same as the original swf) ' or as the following source code (uncomment to enable): ' swf.ConversionTimeout = 1000 * (swf.FrameCount / swf.MovieFPS) swf.InputSWFFileName = "test.swf" swf.OutputVideoFileName = "test.wmv" swf.SetProgressNotifyWindow(Handle.ToInt32(), WM_CONVERSION_PROGRESS, 0) swf.Run() End If End Sub Protected Overloads Overrides Sub WndProc(ByRef m As Message) If m.HWnd = Handle AndAlso m.Msg = WM_CONVERSION_PROGRESS Then progressBar1.Value = m.WParam.ToInt32() End If MyBase.WndProc(m) End Sub End Class

Try ByteScout SWF To Video SDK today: 60 Day Free Trial (on-premise version) or sign up for Web API (on demand version)

Program.vb
      
' 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.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

Try ByteScout SWF To Video SDK today: 60 Day Free Trial (on-premise version) or sign up for Web API (on demand version)

VIDEO

ON-PREMISE VERSION

Get 60 Day Free Trial or Visit ByteScout SWF To Video SDK page

Explore ByteScout SWF To Video SDK documentation

WEB API

Sign Up for free Web API key

Explore Web API Documentation

Tutorials:

prev
next