ShowUnderlayDlg Example for Visual Basic

   
Private Sub Underlay_Click()
	Dim RasterKrnDlg As New LEADRasterDlgKrn_U
	Dim RasterImgEfxDlg As New LEADRasterDlgImgEfx_U
	Dim nRet As Integer
	Dim i As Integer
	   
	RasterKrnDlg.InitDlg 0
	RasterImgEfxDlg.ItemsCount = 3
	RasterImgEfxDlg.ItemFileName(0) = "c:\image1.cmp"
	RasterImgEfxDlg.ItemFileName(1) = "c:\image2.cmp"
	RasterImgEfxDlg.ItemFileName(2) = "c:\image3.cmp"

	For i = 0 To RasterImgEfxDlg.ItemsCount - 1
		LEADUnderlay.Load RasterImgEfxDlg.ItemFileName(i), 0, 0, 1
		RasterImgEfxDlg.ItemDescription(i) = RasterImgEfxDlg.ItemFileName(i)
		RasterImgEfxDlg.ItemBitmap(i) = LEADUnderlay.Bitmap
	Next i

	RasterImgEfxDlg.ImageEffectFlags = UNDERLAY_TILE
	RasterImgEfxDlg.UIFlags = UNDERLAY_SHOW_PREVIEW Or _
								UNDERLAY_SHOW_TOOL_ZOOMLEVEL

	RasterImgEfxDlg.Bitmap = LEAD1.Bitmap
	nRet = RasterImgEfxDlg.ShowUnderlayDlg(hWnd)
	If (nRet = 0 And RasterImgEfxDlg.DialogStatus = DLG_OK) Then
		LEAD1.Underlay RasterImgEfxDlg.SelectedBitmap, RasterImgEfxDlg.ImageEffectFlags
	End If

	RasterKrnDlg.FreeDlg
End Sub