ShowRemapIntensityDlg Example for Visual Basic

Private Sub RemapIntensity_Click()
	Dim RasterColorDlg As New LEADRasterDlgClr_U
	Dim RasterKrnDlg As New LEADRasterDlgKrn_U
	Dim nRet As Integer
	Dim i As Integer

	RasterKrnDlg.InitDlg 0
	RasterColorDlg.Channel = CHANNEL_RED
	RasterColorDlg.UIFlags = REMAPINTENSITY_SHOW_PREVIEW Or _
							REMAPINTENSITY_SHOW_TOOL_ZOOMLEVEL

	RasterColorDlg.Bitmap = LEAD1.Bitmap
	nRet = RasterColorDlg.ShowRemapIntensityDlg(hWnd)

	If (nRet = 0 And RasterColorDlg.DialogStatus = DLG_OK) Then
		LEAD1.RemapTableSize = RasterColorDlg.RemapTableSize
		For i = 0 To RasterColorDlg.RemapTableSize - 1
			LEAD1.RemapTable(i) = RasterColorDlg.RemapTable(i)
		Next i
		LEAD1.RemapIntensity RasterColorDlg.Channel
	End If
	RasterKrnDlg.FreeDlg
End Sub