Using Imaging Common Dialog (Visual Basic Script)
1. |
Start with the project that you created in Loading and Displaying an Image. |
2. |
Add the following code to add the imaging file common dialog COM object to your page: |
<OBJECT ID="LEADRasterDlg1" NAME="LEADRasterDlg1"
CLASSID="CLSID: 00140B79-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrdg14n.cab">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>
3. |
Modify the LoadImage procedure as follows: |
Dim nRet
Dim DLG_FO_AUTOPROCESS
Dim DLG_FO_PROGRESSIVE
Dim DLG_FO_MULTIPAGE
Dim DLG_FO_LOADROTATED
Dim DLG_FO_LOADCOMPRESSED
Dim DLG_FO_FILEINFO
Dim DLG_FO_SHOWPREVIEW
DLG_FO_AUTOPROCESS = 1
DLG_FO_PROGRESSIVE = 2
DLG_FO_MULTIPAGE = 4
DLG_FO_LOADROTATED = 8
DLG_FO_LOADCOMPRESSED = 16
DLG_FO_FILEINFO = 32
DLG_FO_SHOWPREVIEW = 64
LEADRasterDlg1.FileDlgFlags = 0
LEADRasterDlg1.DialogTitle = "Open a File"
LEADRasterDlg1.Filter = "All|*.*|CMP|*.cmp|JPEG|*.jpg"
LEADRasterDlg1.FilterIndex = 2 'look for .cmp first
LEADRasterDlg1.InitialDir = "s:\temp\images\"
LEADRasterDlg1.LoadPasses = 0
LEADRasterDlg1.LoadRotated = True
LEADRasterDlg1.LoadCompressed = False
LEADRasterDlg1.Raster = LeadRasterView1.Raster
LEADRasterDlg1.UIFlags = DLG_FO_AUTOPROCESS + DLG_FO_PROGRESSIVE + DLG_FO_MULTIPAGE + DLG_FO_LOADROTATED + DLG_FO_LOADCOMPRESSED + DLG_FO_FILEINFO + DLG_FO_SHOWPREVIEW
nRet = LEADRasterDlg1.ShowOpenDlg LEADRasterView1.Window
If (nRet = 0) Then
LEADRasterView1.ForceRepaint
End If
4. |
Run you page to test it. |