Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

tuvd

Directx 9 Colors

This topic is 5561 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

I was wondering if there was a way of converting Long color values in to System.Drawing.Color Format, beacuse i have a little prob when trying to create my heightmap data i cant figure out the color equvalents for my long arguments in dx8. Thanx in advance help much apreacheated.

Share this post


Link to post
Share on other sites
Advertisement
if the colors are made from RGB, then you can do it like this:
long color;
BYTE red,green,blue;
red=color & 255;
green=(color/256) & 255;
blue=(color/655536) & 255;

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by Ilankt
if the colors are made from RGB, then you can do it like this:
long color;
BYTE red,green,blue;
red=color & 255;
green=(color/256) & 255;
blue=(color/655536) & 255;



I think he meant blue=(color/65536) & 255;

Share this post


Link to post
Share on other sites
Thanx for your help. I get what u mean but my values were in F00f etc format, but im thinking of scraping that idea, was wondering what would be the best way possible of doing a world map (Of Earth).

I was thinking load a real map color pic in to another program
which i will write which scanes the pixels and lets u set the
value for the different colors, then u can save the file n load it in to the engine, and use it as a reference guide for the heightmap. Or is there a eaisier way of doing it?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!