Converting set of images to video using Bytescout Image To Video SDK in Visual Basic .NET - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

Converting set of images to video using Bytescout Image To Video SDK in Visual Basic .NET

  • Home
  • /
  • Articles
  • /
  • Converting set of images to video using Bytescout Image To Video SDK in Visual Basic .NET

This VB.NET sample source code shows how to convert set of JPG, PNG, BMP images to AVI or WMV video slideshow using Image To Video SDK in Visual Basic .NET.

The SDK provides set of methods and properties to convert image to video (compressed with the selected video compression codec, one of the available on your computer or Bytescout Lossless Video Codec included with the SDK).

Imports BytescoutImageToVideoLib

Module Module1

Sub Main()

Console.WriteLine("Converting JPG slides into video, please wait..")

' Create BytescoutImageToVideoLib.ImageToVideo object instance
Dim converter As ImageToVideo = New 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)
converter.Slides.DefaultSlideInEffect = 1 ' teFadeIn (1) - fades in effect for slides transition
converter.Slides.DefaultSlideInEffectDuration = 500 ' 500 msec for in effect

' Add images and set the duration for every slide
Dim slide As Slide
slide = CType(converter.AddImageFromFileName("........slide1.jpg"), Slide)

slide.Duration = 3000 ' 3000ms = 3s
slide = CType(converter.AddImageFromFileName("........slide2.jpg"), Slide)

slide.Duration = 3000
slide = CType(converter.AddImageFromFileName("........slide3.jpg"), Slide)

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()

Console.WriteLine("Conversion is done. Press any key to continue...")

Console.ReadKey

' Open the result video file in default media player
Process.Start("result.wmv")

End Sub

End Module 

Tutorials:

prev
next