Making a flash slideshow movie with effects from JPEG images in Visual C++ with SWF SlideShow Scout library
“Hello, World!” example
You can download the source code of this example here: swfslideshowscout_vc.zip
This tutorial will show how to generate flash slideshow movie with transition effects from JPG images using movie animation SWF SlideShow Scout library in Visual C++
#include “stdafx.h”
#import “SWFSlideShowScout.tlb”
using namespace SWFSlideShowScout;
int main(int argc, char* argv[])
{
// initialize OLE
HRESULT hr = CoInitialize(NULL);
// check for errors
if (FAILED(hr)) {
MessageBox(0,”OLE initialization errp”,”error”,MB_OK);
return -1;
}
// declare SlideShow object
ISlideShow* SlideShow = NULL;
CLSID clsid;
// get inuque ID for ISlideShow interface
hr = CLSIDFromProgID(OLESTR(“SWFSlideShowScout.SlideShow”), &clsid);
// check for errors
if (FAILED(hr)) {
MessageBox(0,”Can’t get CLSID for interface”,”error”,MB_OK);
goto Uninit;
};
// create SlideShow object
hr = CoCreateInstance(clsid, NULL, CLSCTX_ALL,__uuidof(ISlideShow), (LPVOID*)&SlideShow);
// check for errors
if (FAILED(hr)) {
MessageBox(0,”Can’t create SlideShow object”,”error”,MB_OK);
goto Uninit;
}
// initialize library
SlideShow->InitLibrary(“demo”, “demo”);
// start slideshow movie generation
SlideShow->BeginSlideShow(320,240);
// slide #1, show with “stetMosaicLarge” effect (11 = stetMosaicLarge), 1000 msec
SlideShow->AddSlideFromFileName (“Slide1.jpg”, stetMosaicLarge, 1000);
SlideShow->AddDelay (1000);
// slide #2, show with “stetBlur” effect, 1000 msec
SlideShow->AddSlideFromFileName (“Slide2.jpg”, stetBlur, 1000);
SlideShow->AddDelay (1000);
// slide #3, show with “stetZoomCircle” effect , 1000 msec
SlideShow->AddSlideFromFileName(“Slide3.jpg”, stetZoomCircle, 1000);
SlideShow->AddDelay (1000);
// slide #4, show with “stetLiquid” effect, 1000 msec
SlideShow->AddSlideFromFileName(“Slide4.jpg”, stetLiquid, 1000);
SlideShow->AddDelay (1000);
// slide #5, show with “stetShuttersBias” effect, 1000 msec
SlideShow->AddSlideFromFileName(“Slide5.jpg”, stetShuttersBias, 1000);
SlideShow->AddDelay (2000);
// save to file
SlideShow->SaveToFile(“HelloWorld.swf”);
// disconnect from library
SlideShow->Release();
// uninitialize OLE libraries
Uninit:
CoUninitialize();
return 0;
}
You can download the source code of this example here: swfslideshowscout_vc.zip