 RGBQUAD
Dim lC As Long
Static i As Long
Static lGS As Long

   lC = GetDIBColorTable(m_hDC, 0, 256, tRGB(0))
   Debug.Assert (lC = 256)
   If (lC &gt; 0) Then
      For i = 0 To lC
         lGS = (222&amp; * tRGB(i).rgbRed + 707&amp; * tRGB(i).rgbGreen + 71&amp; *
          tRGB(i).rgbBlue) / 1000&amp;
         tRGBOut(i).rgbBlue = lGS
         tRGBOut(i).rgbGreen = lGS
         tRGBOut(i).rgbRed = lGS
      Next
      lC = SetDIBColorTable(m_hDC, 0, 256, tRGBOut(0))
      Debug.Assert (lC = 256)
   End If