PDA

View Full Version : image data in memory--how to load it into back buffer??


celu
11-23-2006, 06:48 AM
i have my image data in an array.i want to load it onto the back buffer.it tried a number of ways..including creating a plain surface and then trying the D3DXLoadSurfaceFromFileInMemory() function. But when i pass the pointer to the array the function fails.Can i pass the array pointer directly to this function?

or should i may be create an HBITMAP object from this array before passing it to this function?....or is there any other easier way for loading my backbuffer with this image data....HELP!!!

Reedbeta
11-23-2006, 09:49 AM
Just lock the backbuffer to get a pointer, then copy the image data directly into it.

Oybl
11-23-2006, 09:51 AM
You can only copy to backbuffer from renderttarget textures with StretchRect (or from plain surface, but the dimensions must be the same).

Nils Pipenbrinck
11-23-2006, 10:42 AM
unless you have a very good reason to do it with the CPU, load the image into a texture and blit it onto the backbuffer.

That'll be a lot faster.