From: Peter Duniho on
Jeff Gaines wrote:
> On 03/04/2010 in message <uP83NRu0KHA.4412(a)TK2MSFTNGP02.phx.gbl> Peter
> Duniho wrote:
>
>>> It doesn't get decomposed.
>>
>> Unless it's a palette index, it does. And you don't create palette
>> indices by composing 8-bit RGB values into a single 32-bit int.
>
> I have no idea now what it represents,

As I said, it represents a 24-bit RGB value (the highest byte is unused).

> but it works and it was the
> standard way of turning a Color into whatever cards.dll needed. [...]

No, it doesn't work. I've already explained why. You can test it
yourself if you don't believe me, using the example I provided.

Pete
From: Jeff Gaines on
On 03/04/2010 in message <u8DGF500KHA.3652(a)TK2MSFTNGP04.phx.gbl> Peter
Duniho wrote:

>No, it doesn't work. I've already explained why. You can test it
>yourself if you don't believe me, using the example I provided.

The advice you give in this group is often very good but you do have a
tendency to slip into the 'I'm right and everybody else is wrong' mode
from time to time.

I've had enough of this discussion, I use the function as posted with the
cards.dll library and it gives the expected results. In my mind that
counts as working so I'm happy with it.

--
Jeff Gaines Dorset UK
There are 10 types of people in the world, those who do binary and those
who don't.
From: Peter Duniho on
Jeff Gaines wrote:
> On 03/04/2010 in message <u8DGF500KHA.3652(a)TK2MSFTNGP04.phx.gbl> Peter
> Duniho wrote:
>
>> No, it doesn't work. I've already explained why. You can test it
>> yourself if you don't believe me, using the example I provided.
>
> The advice you give in this group is often very good but you do have a
> tendency to slip into the 'I'm right and everybody else is wrong' mode
> from time to time.

I don't know what you're talking about. This isn't the kind of question
that is open to debate. The cards.dll has a documented API, as well as
testable behavior.

This isn't about just one person being right and everybody else being
wrong. Quite the contrary: only one person has made an incorrect
statement (you), and I've made only factual, demonstrably correct
statements that are consistent with everyone else's.

Frankly, your attempt to shift the discussion from the technical merits
to a personal attack is a good indicator as to just how confident you
are about your own position. People arguing on the basis of facts don't
have a need to cast aspersions on others. They stick to the facts,
rather than making insults as you've done here.

But, as long as you've raised the question, I'll point out that I don't
have any trouble at all admitting when I've made a mistake, especially
when the correct answer is clearly documented and/or discoverable. I've
done so in the past, and I expect to do so in the future. How about you?

> I've had enough of this discussion, I use the function as posted with
> the cards.dll library and it gives the expected results. In my mind that
> counts as working so I'm happy with it.

Just because you haven't noticed the subtle difference between "correct"
and "almost correct", that doesn't mean your code is correct.

Pete
From: Tim Roberts on
"Jeff Gaines" <jgaines_newsid(a)yahoo.co.uk> wrote:
>
>I've had enough of this discussion, I use the function as posted with the
>cards.dll library and it gives the expected results. In my mind that
>counts as working so I'm happy with it.

Look, your code is CLOSE, and for you it may be WORKABLE, but it's not
right. That, sir, is an indisputable fact. Here is the code you posted:

private int RGBColour(Color colTemp)
{
int intColour = colTemp.B * 255 * 255;
intColour += colTemp.G * 255;
intColour += colTemp.R;
return intColour;
}

Need an example? Try running the color "white" through your code. In
white, R, G, and B are 255. Your code produces the hex result 0xFE01FF.
Does that strike you as the same thing as 0xFFFFFF? That is what "white"
should be, and what it WOULD be if you had used 256 instead of 255 as your
constants.

Try gray, (128,128,128). You should get 0x808080. Instead, you produce
0x7F8080.

You are welcome to stick with it, and for a card-playing application
perhaps you'll never notice, but your code is WRONG.
--
Tim Roberts, timr(a)probo.com
Providenza & Boekelheide, Inc.