Getting Started with Image To Video SDK

  • Home
  • /
  • Getting Started with Image To Video SDK

To view the documentation for the SDK go to Start > All Programs > ByteScout Image To Video SDK and click the “Documentation” link.

The SDK comes with lot of ready-to-use source code examples for Visual Basic, C#, ASP.NET, VB6, VBScript, classic ASP.

To find source code samples please go to “My Documents” folder, “ByteScout Samples” and “Image To Video SDK”. Do not hesitate to copy and paste code snippets from samples right into your application!

The First Application

To help you get the most out of your evaluation, here is the quick instructions on converting set of images into a slideshow WMV video file.

  • run Visual Studio and create New Project.
  • add reference to Image To Video SDK using Project | Add Reference. In the Add Reference dialog select “Bytescout Image To Video Lib” and click OK.
  • copy-and-paste the following code:

Visual Basic:

Imports <span data-scayt_word="BytescoutImageToVideoLib" data-scaytid="61">BytescoutImageToVideoLib</span>

Module <span data-scayt_word="Module1" data-scaytid="63">Module1</span>

Sub Main()

<span data-scayt_word="Console.WriteLine" data-scaytid="2">Console.WriteLine</span>("Converting JPG slides into video, please wait..")

' Create <span data-scayt_word="BytescoutImageToVideoLib.ImageToVideo" data-scaytid="5">BytescoutImageToVideoLib.ImageToVideo</span> object instance
Dim converter As <span data-scayt_word="ImageToVideo" data-scaytid="64">ImageToVideo</span> = New <span data-scayt_word="ImageToVideo" data-scaytid="65">ImageToVideo</span>()

' Activate the component
<span data-scayt_word="converter.RegistrationName" data-scaytid="7">converter.RegistrationName</span> = "demo"
<span data-scayt_word="converter.RegistrationKey" data-scaytid="9">converter.RegistrationKey</span> = "demo"

' set default in effect for slides (you can also set effects for each single slide)
<span data-scayt_word="converter.Slides.DefaultSlideInEffect" data-scaytid="11">converter.Slides.DefaultSlideInEffect</span> = 1 ' <span data-scayt_word="teFadeIn" data-scaytid="68">teFadeIn</span> (1) - fades in effect for slides transition
<span data-scayt_word="converter.Slides.DefaultSlideInEffectDuration" data-scaytid="12">converter.Slides.DefaultSlideInEffectDuration</span> = 500 ' 500 <span data-scayt_word="msec" data-scaytid="69">msec</span> for in effect


' Add images and set the duration for every slide
Dim slide As Slide
slide = <span data-scayt_word="CType" data-scaytid="70">CType</span>(<span data-scayt_word="converter.AddImageFromFileName" data-scaytid="13">converter.AddImageFromFileName</span>("........<span data-scayt_word="slide1.jpg" data-scaytid="19">slide1.jpg</span>"), Slide)
<span data-scayt_word="slide.Duration" data-scaytid="21">slide.Duration</span> = 3000 ' <span data-scayt_word="3000ms" data-scaytid="73">3000ms</span> = <span data-scayt_word="3s" data-scaytid="75">3s</span>
slide = <span data-scayt_word="CType" data-scaytid="71">CType</span>(<span data-scayt_word="converter.AddImageFromFileName" data-scaytid="14">converter.AddImageFromFileName</span>("........<span data-scayt_word="slide2.jpg" data-scaytid="27">slide2.jpg</span>"), Slide)
<span data-scayt_word="slide.Duration" data-scaytid="22">slide.Duration</span> = 3000
slide = <span data-scayt_word="CType" data-scaytid="72">CType</span>(<span data-scayt_word="converter.AddImageFromFileName" data-scaytid="15">converter.AddImageFromFileName</span>("........<span data-scayt_word="slide3.jpg" data-scaytid="29">slide3.jpg</span>"), Slide)
<span data-scayt_word="slide.Duration" data-scaytid="23">slide.Duration</span> = 3000

' Set output video size
<span data-scayt_word="converter.OutputWidth" data-scaytid="31">converter.OutputWidth</span> = 400
<span data-scayt_word="converter.OutputHeight" data-scaytid="33">converter.OutputHeight</span> = 300

' Set output video file name
<span data-scayt_word="converter.OutputVideoFileName" data-scaytid="35">converter.OutputVideoFileName</span> = "<span data-scayt_word="result.wmv" data-scaytid="37">result.wmv</span>"

' Run the conversion
<span data-scayt_word="converter.RunAndWait" data-scaytid="41">converter.RunAndWait</span>()

<span data-scayt_word="Console.WriteLine" data-scaytid="3">Console.WriteLine</span>("Conversion is done. Press any key to continue...")
<span data-scayt_word="Console.ReadKey" data-scaytid="43">Console.ReadKey</span>


' Open the result video file in default media player
<span data-scayt_word="Process.Start" data-scaytid="45">Process.Start</span>("<span data-scayt_word="result.wmv" data-scaytid="38">result.wmv</span>")

End Sub

End Module

C#:

using System;
using <span data-scayt_word="System.Diagnostics" data-scaytid="47">System.Diagnostics</span>;
using <span data-scayt_word="BytescoutImageToVideoLib" data-scaytid="62">BytescoutImageToVideoLib</span>;

<span data-scayt_word="namespace" data-scaytid="77">namespace</span> <span data-scayt_word="SimpleSlideshow" data-scaytid="78">SimpleSlideshow</span>
{
class Program
{
static void Main(string[] <span data-scayt_word="args" data-scaytid="79">args</span>)
{
<span data-scayt_word="Console.Write" data-scaytid="48">Console.Write</span>("Converting JPG slides into video, please wait..");

// Create <span data-scayt_word="BytescoutImageToVideoLib.ImageToVideo" data-scaytid="6">BytescoutImageToVideoLib.ImageToVideo</span> object instance
<span data-scayt_word="ImageToVideo" data-scaytid="66">ImageToVideo</span> converter = new <span data-scayt_word="ImageToVideo" data-scaytid="67">ImageToVideo</span>();

// Activate the component
<span data-scayt_word="converter.RegistrationName" data-scaytid="8">converter.RegistrationName</span> = "demo";
<span data-scayt_word="converter.RegistrationKey" data-scaytid="10">converter.RegistrationKey</span> = "demo";

// Add images and set the duration for every slide
Slide slide;
slide = (Slide) <span data-scayt_word="converter.AddImageFromFileName" data-scaytid="16">converter.AddImageFromFileName</span>("..\..\..\..\<span data-scayt_word="slide1.jpg" data-scaytid="20">slide1.jpg</span>");
<span data-scayt_word="slide.Duration" data-scaytid="24">slide.Duration</span> = 3000; // <span data-scayt_word="3000ms" data-scaytid="74">3000ms</span> = <span data-scayt_word="3s" data-scaytid="76">3s</span>
slide = (Slide) <span data-scayt_word="converter.AddImageFromFileName" data-scaytid="17">converter.AddImageFromFileName</span>("..\..\..\..\<span data-scayt_word="slide2.jpg" data-scaytid="28">slide2.jpg</span>");
<span data-scayt_word="slide.Duration" data-scaytid="25">slide.Duration</span> = 3000;
slide = (Slide) <span data-scayt_word="converter.AddImageFromFileName" data-scaytid="18">converter.AddImageFromFileName</span>("..\..\..\..\<span data-scayt_word="slide3.jpg" data-scaytid="30">slide3.jpg</span>");
<span data-scayt_word="slide.Duration" data-scaytid="26">slide.Duration</span> = 3000;

// Set output video size
<span data-scayt_word="converter.OutputWidth" data-scaytid="32">converter.OutputWidth</span> = 400;
<span data-scayt_word="converter.OutputHeight" data-scaytid="34">converter.OutputHeight</span> = 300;

// Set output video file name
<span data-scayt_word="converter.OutputVideoFileName" data-scaytid="36">converter.OutputVideoFileName</span> = "<span data-scayt_word="result.wmv" data-scaytid="39">result.wmv</span>";

// Run the conversion
<span data-scayt_word="converter.RunAndWait" data-scaytid="42">converter.RunAndWait</span>();

<span data-scayt_word="Console.WriteLine" data-scaytid="4">Console.WriteLine</span>("Conversion is done. Press any key to continue..");
<span data-scayt_word="Console.ReadKey" data-scaytid="44">Console.ReadKey</span>();


// Open the result video file in default media player
<span data-scayt_word="Process.Start" data-scaytid="46">Process.Start</span>("<span data-scayt_word="result.wmv" data-scaytid="40">result.wmv</span>");
}
}
}
  • press F5 to compile and run your first application!

The application code above converts set of images into the video slideshow file with slide transition video effects.

More Samples

For more source code samples go to “ByteScout Samples / Image To Video SDK ” folder in “My Documents”.

Evaluation version adds a reminder text at the bottom of output video file.

You are welcome to purchase a license for the SDK at http://bytescout.com/buy/imagetovideosdk.html

We provide 30-Day Unconditional Money Back Guarantee for the SDK!

Have a Question?

Contact us at support@bytescout.com or use the online contact form at https://bytescout.com/support/index.php?_m=tickets&_a=submit&step=1&departmentid=2

Thanks again for evaluating Image To Video SDK!

Tutorials: