ShowSaveDlg Example for Visual Basic

Private Sub Save_Click()
	Dim RasterFileDlg As New LEADRasterDlgFile_U
	Dim RasterKrnDlg As New LEADRasterDlgKrn_U
	Dim nRet As Integer

	RasterKrnDlg.InitDlg 0
	RasterFileDlg.DialogTitle = "Save a File"
	RasterFileDlg.FileDlgFlags = 0
	RasterFileDlg.InitialDir = "C:\"
	RasterFileDlg.SaveMulti = MULTIPAGE_OVERWRITE
	RasterFileDlg.UIFlags = SAVE_AUTOPROCESS Or _
						   SAVE_SHOW_FILEOPTIONS_PROGRESSIVE Or _
						   SAVE_SHOW_FILEOPTIONS_MULTIPAGE Or _
						   SAVE_SHOW_FILEOPTIONS_STAMP Or _
						   SAVE_SHOW_FILEOPTIONS_QFACTOR Or _
						   SAVE_SHOW_FILEOPTIONS_J2KOPTIONS Or _
						   SAVE_SHOW_FILEOPTIONS_BASICJ2KOPTIONS
	RasterFileDlg.Bitmap = LEAD1.Bitmap
	nRet = RasterFileDlg.ShowSaveDlg(hWnd)
	If (nRet = 0 And RasterFileDlg.DialogStatus = DLG_OK) Then
		Text1.Text = RasterFileDlg.FileName
		Text2.Text = CStr(RasterFileDlg.SaveBitsPerPixel)
		Text3.Text = CStr(RasterFileDlg.SaveQFactor)
		Text4.Text = CStr(RasterFileDlg.SaveMulti)
		Text5.Text = CStr(RasterFileDlg.SaveFormat)
		Text6.Text = CStr(RasterFileDlg.SavePasses)
		Text7.Text = CStr(RasterFileDlg.SaveWithStamp)
		If (RasterFileDlg.SaveWithStamp = False) Then
			Text8.Text = CStr(RasterFileDlg.SaveStampBits)
			Text9.Text = CStr(RasterFileDlg.SaveStampWidth)
			Text10.Text = CStr(RasterFileDlg.SaveStampHeight)
		End If
	End If
	RasterKrnDlg.FreeDlg
End Sub