Getting Started in Visual Basic 6 (as ActiveX)ByteScout Image To Video SDK

This Visual Basic 6 sample shows how to convert set of images into video (WMV or AVI) using Image To Video SDK.

INFORMATION: full source code for this sample is available in My Documents | ByteScout Samples | Image To Video SDK

VB
Private Sub Command1_Click()

' First add the reference to the object using Project | References and then check reference to Bytescout Image To Video type library and click OK

' Dim converter object
Dim converter As BytescoutImageToVideo.ImageToVideo

' Create an instance of BytescoutImageToVideo.ImageToVideo ActiveX object
Set converter = CreateObject("BytescoutImageToVideo.ImageToVideo")

' Activate the component
converter.RegistrationName = "demo"
converter.RegistrationKey = "demo"

' set default in effect for slides (you can also set effects for each single slide)
Dim Slides As BytescoutImageToVideo.Slides
Set Slides = converter.Slides
Slides.DefaultSlideInEffect = 1 ' teFadeIn (1) - fades in effect for slides transition
Slides.DefaultSlideInEffectDuration = 500 ' 500 msec for in effect

' Add images and set the duration for every slide
Dim Slide As BytescoutImageToVideo.Slide

Set Slide = converter.AddImageFromFileName("..\..\slide1.jpg")
Slide.Duration = 3000 ' 3000ms = 3s

Set Slide = converter.AddImageFromFileName("..\..\slide2.jpg")
Slide.Duration = 3000

Set Slide = converter.AddImageFromFileName("..\..\slide3.jpg")
Slide.Duration = 3000

' Set output video size
converter.OutputWidth = 400
converter.OutputHeight = 300

' Set output video file name
converter.OutputVideoFileName = "result.wmv"

' Run the conversion
converter.RunAndWait

' Open result in default media player
' Set Shell = CreateObject("WScript.Shell")
' Shell.Run "result.wmv", 1, False
' Set Shell = Nothing

Set converter = Nothing

End Sub