Jump to content
  • Advertisement
Sign in to follow this  
xytor

LockRect returning non-rgb values

This topic is 2853 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!