Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / 2d Dot/Point problems

Author
Message
Dark Nutter
21
Years of Service
User Offline
Joined: 1st Jul 2004
Location:
Posted: 27th Sep 2004 01:49
Hello, This is my problem,
When I plot a pixel with the <dot> command,
And when I point to it with the <point> command, I then try to <dot> the pixel again by converting the <point> value to a colour value, the value of the colour is different to the original dot. Why is this differnce happening please?

Chow
Flashing Blade
23
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 27th Sep 2004 20:18
Works ok for me although needed a cls to read b.

I just added cls and sync too your code.

Click source:


The word "Gullible" cannot be found in any English Dictionary.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Sep 2004 07:47
This problem may be because you are running in 16 bit mode.

When you draw a dot, the 32 bits have to be reduced to 16 bits. This is usually done by dropping the lower 3 bit of red and blue, and the lower 2 of green (or on older cards, the lower 3 bits of each colour). Those bits are just lost.

When you read the pixel with the point function, it converts the colours back to 32 bits - 8 bits each for red, green and blue - and fills in the lower bits with some extra bits that calculated.

Because of these two conversions, the colour you feed in may not be the colour that you get back.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk

Login to post a reply

Server time is: 2026-06-11 17:33:05
Your offset time is: 2026-06-11 17:33:05