Works fine for me and you're code looks ok, but ... looks like trouble, a guest would be you're not specifying pf24bit bitmap format, if I'm mistaken post more code.