ShowRemapHueDlg Example for Visual Basic

Private Sub RemapHue_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.UIFlags = REMAPHUE_SHOW_PREVIEW Or _
							REMAPHUE_SHOW_TOOL_ZOOMLEVEL
	RasterColorDlg.Bitmap = LEAD1.Bitmap

	nRet = RasterColorDlg.ShowRemapHueDlg(hWnd)
	If (nRet = 0 And RasterColorDlg.DialogStatus = DLG_OK) Then
		LEAD1.RemapHueTablesSize = RasterColorDlg.RemapHueTablesSize
		For i = 0 To RasterColorDlg.RemapHueTablesSize - 1	  
			LEAD1.MaskTable(i) = RasterColorDlg.MaskTable(i)
			LEAD1.HTable(i) = RasterColorDlg.HueTable(i)
			LEAD1.STable(i) = RasterColorDlg.SaturationTable(i)
			LEAD1.VTable(i) = RasterColorDlg.ValueTable(i)
		Next i
		LEAD1.RemapHue True, True, False, False
	End If
	RasterKrnDlg.FreeDlg
End Sub