http://www.codeproject.com/bitmap/ColorCursorFromBmp.asp
I didn't try it so I can't confirm if it will work or not.
BTW, the SetPixel is a dumb way to creare the masks (and very slow), check the comments, there is one with a code using instead monochrome bitmaps.