1 <%
2 ' This code will show you how to CONVERT the image to the destination format
3 ' The free version can convert the GIF, JPEG, BMP, PNG format 
4 ' to the JPEG format only.
5   
6 Dim oGraphic
7 Set oGraphic = Server.CreateObject("PhotoSprite.Graphic")
8   
9   ' Original image name
10   oGraphic.SourceFile = Server.MapPath( "images/demo.jpg" )
11   
12   ' Destination image name, and can make the same as the original image name
13   oGraphic.DestFile   = Server.MapPath( "images/tmp/convertformat.jpg" )
14   
15   ' JPEG compression ratio which between 1 and 100, default 75
16   oGraphic.JpegCompressionRatio = 50
17   
18   
19   ' Convert image to the destination format
20   oGraphic.ConvertFormat
21   
22 Set oGraphic = Nothing
23 %>
24   
25 <%
26 ' Show the contrastive effect
27 Response.Write "<img src=""images/demo.jpg"" border=""0"">"
28 Response.Write "<img src=""images/tmp/convertformat.jpg"" border=""0"">"
29 %>
30