Archived

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

When to set palette???

This topic is 6604 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'm not using HBRUSH to define a color in direct draw. I'm just blitting simple rectangles on top of random pixels. One of the RECT parameters takes an HBRUSH. Its just that the color ends up blue instead of gray and I'm wondering if this has anything to do with where I attach the palette at or is it because of something else. Thanks, friz

------------------
Still Learning...

Share this post


Link to post
Share on other sites
The brushes specified in the window headers, are al numbers. Everything is just a number in windows. So, if you use the Gray Brush, you will actually use an integer number.

So, if that number is blue in the palette you have set, than you will end up with blue in the place you draw the rectangle.

------------------
Dance with me......

Share this post


Link to post
Share on other sites

I need to know when I should set the palette.
I created a simple primary surface in my Init() function and then in my Main() I simply plot random pixels and blit random RECT's over top of it. The rect are given an (HBRUSH)GRAY_BRUSH parameter but the rectangles end up blue. I tried setting the palette to my lpddpalette object in the Init() and also at the very end of Main() before it returns. Both ways end up with the same results. Any ideas?

------------------
Still Learning...

Share this post


Link to post
Share on other sites