I just added a sample project
note that the texture parameter is modified in the process (turned into grayscale), and that also it cannot be of an indexed image format (because GDI+ doesnt support this)