Tutorial: how to generate flash slideshow movie using SWF SlideShow Scout library in ASP.NET (on ASP.NET web-server) - ByteScout

Tutorial: how to generate flash slideshow movie using SWF SlideShow Scout library in ASP.NET (on ASP.NET web-server)

  • Home
  • /
  • Articles
  • /
  • Tutorial: how to generate flash slideshow movie using SWF SlideShow Scout library in ASP.NET (on ASP.NET web-server)
How to create SWF flash animations movies using SWF SlideShow Scout library in ASP.NET environment
“Hello, World!” example
 

You can download the source code of this example here: swfslideshowscout_asp_net.zip

This page contains step by step tutorial how to create SWF flash animation file in ASP.NET using SWF SlideShow Scout library.

 
 
IMPORTANT NOTE: To use SWF SlideShow Scout library on web-server you have to have additional “Web License”
 
SWF SlideShow Scout library is capable of generating of in-memory flash files (slideshow) so temporary files are not used and produced flash slideshow is streamed right to the browser window. 
  
1) Install SWF SlideShow Scout library on your computer and run Visual Studio.NET
2) Go to File menu and select New Project:
 
New project menu
 
Select ASP.NET Web Application project type and click OK
 
ASP.NET new project wizard
 
3) Visual Studio.NET will create new empty ASP.NET project. Double-click on the empty space of the form:
 
New blank project generated by ASP.NET
 
This will open source code editor window on procedure handling Page_Load event. We will place our code for  SWF slideshow animation generation into this procedure:
 
Page load handler procedure generated by ASP.NET IDE
 
4) Use the following code for procedure (you can simply copy and paste this code from this page into ASP.NET source code editor window):

‘Put user code to initialize the page here
Dim SlideShow
Dim Size As Long
Dim MemoryImage As System.Array

SlideShow = CreateObject(“SWFSlideShowScout.SlideShow”)

‘ initialize library
SlideShow.InitLibrary(“demo”, “demo”)

SlideShow.BeginSlideShow(320, 240)

‘ slide #1, show with “stetMosaicLarge” effect, 1000 msec
SlideShow.AddSlideFromFileName(“Slide1.jpg”, SWFSlideShowScout.SlideTransitionEffectType.stetMosaicLarge, 1000)
SlideShow.AddDelay(1000)

‘ slide #2, show with “stetBlur” effect, 1000 msec
SlideShow.AddSlideFromFileName(“Slide2.jpg”, SWFSlideShowScout.SlideTransitionEffectType.stetBlur, 1000)
SlideShow.AddDelay(1000)

‘ slide #3, show with “stetZoomCircle” effect, 1000 msec
SlideShow.AddSlideFromFileName(“Slide3.jpg”, SWFSlideShowScout.SlideTransitionEffectType.stetZoomCircle, 1000)
SlideShow.AddDelay(1000)

‘ slide #4, show with “stetLiquid” effect, 1000 msec
SlideShow.AddSlideFromFileName(“Slide4.jpg”, SWFSlideShowScout.SlideTransitionEffectType.stetLiquid, 1000)
SlideShow.AddDelay(1000)

‘ slide #5, show with “stetShuttersBias” effect , 1000 msec
SlideShow.AddSlideFromFileName(“Slide5.jpg”, SWFSlideShowScout.SlideTransitionEffectType.stetShuttersBias, 1000)
SlideShow.AddDelay(2000)

‘ get size of generated in-memory swf file
Size = SlideShow.BinaryImageSize
‘ create new buffer with size equal to generated swf file
Dim Buffer(CInt(Size)) As Byte
‘ get in-memory slideshow file as byte stream
MemoryImage = SlideShow.BinaryImage
‘ copy byte stream into buffer
Array.Copy(MemoryImage, Buffer, Size)
‘ clear http output
Response.Clear()
‘ set the content type to SWF
Response.ContentType = “application/x-shockwave-flash”
‘ add content type header
Response.AddHeader(“Content-Type”, “application/x-shockwave-flash”)
‘ set the content disposition
Response.AddHeader(“Content-Disposition”, “inline;filename=slideshow.swf”)
‘ write the buffer with swf file to the output
Response.BinaryWrite(Buffer)
Response.End()
‘ disconnect from library
SlideShow = Nothing

 
5) Now run ASP.NET project using Debug | Start command:
 
Start project menu
 
Visual Studio.NET will run ASP.NET project on web-server and you will see Internet Explorer window with generated SWF slideshow animation:

Tutorials:

prev
next