ShowColorResDlg Example for Visual Basic

Dim RasterColorDlg As New LEADRasterDlgClr
Dim RasterProc As New LEADRasterProcess
Dim nRet As Integer

Private Sub ColorRes_Click()
  RasterColorDlg.ClrResFlags = COLORRES_SHOW_BITALL Or _
                              COLORRES_SHOW_DITHER_ALL Or _
                              COLORRES_SHOW_PAL_ALL _

   RasterColorDlg.UIFlags = COLORRES_SHOW_PREVIEW Or _
                            COLORRES_SHOW_OPENPALFILE Or _
                            COLORRES_SHOW_ORDER Or _
                            COLORRES_SHOW_TOOL_ZOOMLEVEL

   RasterColorDlg.Bitmap = LEADRasterView1.Raster.Bitmap
   
   nRet = RasterColorDlg.ShowColorResDlg (hWnd) 
   If (nRet = 0 And RasterColorDlg.DialogStatus = DLG_OK) Then
      RasterProc.ColorRes LEADRasterView1.Raster, RasterColorDlg.BitsPerPixel, _
                            RasterColorDlg.PaletteFlags, _
                            RasterColorDlg.DitherFlags, _
                            0
   End If
End Sub