Sign in to follow this  
xytor

LockRect returning non-rgb values

Recommended Posts

Hi, i have a simple directx scene that clears the screen with D3DCOLOR_RGBA(200,100,65,255).
Then I create a surface, call LockRect and read the bits. The values I get should be 65,100,200,0 but I get 71,110,220,0.
What is going on? These values are certainly not the RGB pixels of the screen, but they are somehow related. Does anybody know a function or formula to convert them to RGB?

Share this post


Link to post
Share on other sites
Sounds like you're either not using LockRect() correctly, or your surface isn't D3DFMT_A8R8G8B8 format. Can we see your code where you create the surface and when you lock it?

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
Sounds like you're either not using LockRect() correctly, or your surface isn't D3DFMT_A8R8G8B8 format. Can we see your code where you create the surface and when you lock it?


Actually I was modifying the pixel values with a shader, and accidentally grabbed the output after the shader did some post processing. Sorry to waste your time :(

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