Sign in to follow this  
DX_GAMEDEV_2004

Image Copying

Recommended Posts

Could someone provide some sample code which demonstartes how to copy pixel data onto a standard Direct3D surface. When I say pixel data, I mean the kind of pixel data you'd usually pass to a GDI function like SetDIBitsToDevice (as lpvbits param). Essentially, therefore, I have an array of DIB bits, and I want to copy it onto a Direct3D Surface. Thanks. [Edited by - DX_GAMEDEV_2004 on November 9, 2004 6:58:57 AM]

Share this post


Link to post
Share on other sites
For the thousandth time: [smile]

-Lock the surface. This obtains you a pointer and scanline pitch of the surface.
-Using the pointer, copy your data in the surface.
-Unlock the surface.
-Use it as usual.

This is a very frequently asked question, hence the first remark ;)

Kind regards,
-Nik

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this