ColorRes example for Visual Basic

This example checks to see if the bitmap is 8 bits per pixel and converts it if it is not.

If Lead1.BitmapBits <> 8 Then
    MousePointer = 11 ' hourglass
    Lead1.ColorRes 8, CRP_OPTIMIZEDPALETTE, CRD_FLOYDSTEINDITHERING, 0
    Lead1.ForceRepaint
    MousePointer = 0 ' default
End If