Thank you. It works. But do you think off-screen surface bitcount is 8 bit. Your code: SD.ddpfPixelFormat.dwRGBBitCount := 32; and after bitmasks it will be 8 bit? Why do I want an 8 bit offscreen and 32 bit primary? Because of two reasons:

1) My image is 8 bit and I want to put it in an 8 bit off-screen or backbuffer. And then view it in GDI (of course with an 32 bit primary)

2) For a faster blitting and high FPS. As you know blitting from 8 bit surface to 32 bit primary is faster than blitting from 32 bit surface to 32 bit primary. And I want to use this trick. But I'm still don't sure is it possible under DirectX.

I've looked for it on the web but I don't find any resources. Could you possibly give me some idea about my project if you have?