If lTransparentColour = -1 Then
      lTransparentColour = GetPixel(lHDC, x, y)
   End If
   
   ' Get a copy of the mask at the right position:
   lhDCMaskCopy = CreateCompatibleDC(0)
   If lhDCMaskCopy &lt;&gt; 0 Then
      'lhBMPMask = CreateCompatibleBitmap(lhDCMaskCopy, tBMIH.biWidth,
       tBMIH.biHeight)
      With tBMIMono
         With .bmiHeader
            .biSize = Len(tBMIMono.bmiHeader)
            .biPlanes = 1
            .biHeight = tBMIH.biHeight
            .biWidth = tBMIH.biWidth
     