Writing and Reading Multipage Files (ASP - VBScript)
This example demonstrates how to create a multipage file on the server, then load and display the images from that file. Only TIFF (MPT) and PCX (DCX) formats support multipage files:
<%@ Language=VBScript %>
<%Option Explicit%>
<%
Dim RasterObj1
Dim RasterObj2
Dim RasterIO1
Dim RasterIO2
Dim FILE_TIF
Dim FILE_JFIF
Dim SAVE_OVERWRITE
Dim SAVE_APPEND
Set RasterObj1 = Server.CreateObject("LEADRaster.LEADRaster")
Set RasterObj2 = Server.CreateObject("LEADRaster.LEADRaster")
Set RasterIO1 = Server.CreateObject("LEADRasterIO.LEADRasterIO")
Set RasterIO2 = Server.CreateObject("LEADRasterIO.LEADRasterIO")
FILE_TIF = 3
FILE_JFIF = 10
SAVE_OVERWRITE = 0
SAVE_APPEND = 1
'Load the bitmaps. These hard-coded path names may be different on your system.
RasterIO1.Load RasterObj1, "i:\a\pic\20020816demo3.jpg", 0, 0, 1
RasterIO2.Load RasterObj2, "i:\a\pic\20020816demo2.jpg", 0, 0, 1
'Save the bitmaps to a single multipage TIFF file
RasterIO1.Save RasterObj1, "c:\combined.tif", FILE_TIF, 24, 0, SAVE_OVERWRITE
RasterIO2.Save RasterObj2, "c:\combined.tif", FILE_TIF, 24, 0, SAVE_APPEND
'Load the bitmaps from the multipage TIFF file
RasterIO1.Load RasterObj1, "c:\combined.tif", 24, 1, 1
RasterIO2.Load RasterObj2, "c:\combined.tif", 24, 2, 1
'Save the bitmaps to separate JPEG files to display them in the browser window.
RasterIO1.Save RasterObj1, "c:\temp1.jpg", FILE_JFIF, 24, 2, SAVE_OVERWRITE
RasterIO2.Save RasterObj2, "c:\temp2.jpg", FILE_JFIF, 24, 2, SAVE_OVERWRITE
Response.Write "<IMG SRC='c:\temp1.jpg'>"
Response.Write "<IMG SRC='c:\temp2.jpg'>"
%>