SetPalette( _
      lColor() As Long _
   )
Dim tRGBOut(0 To 256) As RGBQUAD
Dim lC As Long
Dim i As Long

   lC = GetDIBColorTable(m_hDC, 0, 256, tRGB(0))
   For i = LBound(lColor) To UBound(lColor)
      tRGB(i).rgbBlue = (lColor(i) And &amp;HFF0000) \ &amp;H10000
      tRGB(i).rgbGreen = (lColor(i) And &amp;HFF00&amp;) \ &amp;H100&amp;
      tRGB(i).rgbRed = (lColor(i) And &amp;HFF&amp;)
   Next i
   lC = SetDIBColorTable(m_hDC, 0, 256, tRGB(0))
   
End Sub
Public Sub GrayScale()
Dim tRGBOut(0 To 256) As