Getting Started

 When controlling SfImageResize you can use any language available to the server. The examples in this help is primarily written using VBScript but JScript has extensive examples too.

 To use SfImageResize you should obviously have a web server which is capable of using COM. This means that SfImageResize is not just available for ASP programmers but to anyone using a server which can handle Windows COM Objects, such as PHP, Macromedia Cold Fusion, Lotus Notes and more (note that this helpfile and guide is focused entirely on ASP, more information may be available at www.silberfish.com ).

Basic usage

VBScript example:
Set sir = Server.CreateObject("SfImageResize.ImageResize")
sir.LoadFromFile "c:\inetpub\wwwroot\site\images\image.jpg"
sir.Width = 50
sir.DoResize
sir.SaveToFile "c:\inetpub\wwwroot\site\images\image2.jpg"
set sir = nothing

JScript example:
sir = Server.CreateObject( "SfImageResize.ImageResize" );
sir.LoadFromFile( "c:\inetpub\wwwroot\site\images\image.jpg" );
sir.Width = 50;
sir.DoResize();
sir.SaveToFile( "c:\inetpub\wwwroot\site\images\image2.jpg" );
sir = nil;

 This code will load the image c:\inetpub\wwwroot\site\images\image.jpg, changes the width to 50 pixels and then saves the image as c:\inetpub\wwwroot\site\images\image2.jpg. This may be a quite common thing to do when building a thumbnail library.