|
|
|
Hi,I'm a beginner of vc++.Could someone help me?
I use a class writen by other to add bitmap to menus. this class is easy to use. but I've met a problem:
how to change the checkmarks style of the menu?
the class is here :http://www.codeproject.com/menu/bmpmenu.asp[^]
how to update this class?
|
|
|
|
|
Hello.
If you look at the bottom of the page where the article is, you will find a discussion forum, similar to this one.
When you have a question regarding an article, then that's the place to ask your question(s).
That way, you direct your question to the author of the artice and you will have a better chance to get your questions answered.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
|
stop this spam immediately...
you started a thread some minutes ago. why don't you just follow it instead of starting new ones ?
|
|
|
|
|
Same question!?
|
|
|
|
|
i have declered a constants in a Header file in following way
const COLORREF RED = RGB(255,0,0);<br />
const COLORREF GREEN = RGB(0,254,0);<br />
const COLORREF BLUE = RGB(0,0,254);
after that i created a message handler like below for each colour
void CNEWWINDOWView::OnGreen()
View.<br />
{<br />
m_colour=GREEN;<br />
Invalidate();<br />
}<br />
now i have wriien in the ondraw as
CString str2.Format("%d",m_colour);<br />
pDC->TextOut(400,10,"COLOUR:"+str2);
i am geting in the window the value of clour of red as 255,for green 65024,
for blue it is 16646144; why it is displaying like this?
-- modified at 8:22 Wednesday 23rd August, 2006
|
|
|
|
|
Because it is a combination of R,G, and B components.
R + (256*G) + (65536*B)
Steve S
Developer for hire
|
|
|
|
|
i want to display the name of the colours than that of the values on window
can u give me the sugetions to how to do it?
|
|
|
|
|
ramanand_bulusu wrote: i want to display the name of the colours than that of the values on window
You must be kidding
This is crazy: take two seconds to think about what you said. COLOURREF is just a number that holds a the intensity of each color (R, G and B). There is no colour name associated in any way (and this would be completely absurd, imagine the number of names you need to have).
|
|
|
|
|
what about the method GetRValue();
so ur telling that it is impossible to get the name of the colour on the window with respective to selecting colour?
-- modified at 8:37 Wednesday 23rd August, 2006
|
|
|
|
|
ramanand_bulusu wrote: so ur telling that it is impossible to get the name of the colour on the window
There is no name, COLOURREF is a number. Imagine, there is more than 1 million color combination (make the calculation yourself: 256^256^256). And you want to have a specific name for EACH of those colors ??
What you need to display is the intensity of the three channels, there is no other way to do it if you want color info.
|
|
|
|
|
Cedric Moonen wrote: Imagine, there is more than 1 million color combination (make the calculation yourself: 256^256^256)
256^256^256 is rather bigger than a million - I think you mean 256 * 256 * 256 which is 16.7 million colours
|
|
|
|
|
Mmh, yes you are right, I mixed the two (I must be tired)
|
|
|
|
|
name of each color,its
<br />
R=Red<br />
B=Blue<br />
G=Green<br />
|
|
|
|
|
What kind of answer is that ?
|
|
|
|
|
WhiteSky wrote: name of each color,its
R=Red
B=Blue
G=Green
i have already declared the names .just see my question before.
|
|
|
|
|
I dont understand your purpose do you want for example cyna/orange/red/purple and....?
|
|
|
|
|
The colourref is code this way: the last significant byte is for red, the middle byte is for green, and so on.
So it is logical that you get these values:
Red:0x0000FF if you translate that in decimal it makes 255.
Green: 0x00FE00 equal to 65024 in decimal
Blue: 0xFE0000 equal to 16646144 in decimal
What did you expect as a result ??
|
|
|
|
|
i expected each value should be 255 onley.ok thanks for ur explanation.
now i want to display the name of that colour than that of values.what i have to do?
|
|
|
|
|
ramanand_bulusu wrote: i expected each value should be 255 onley...now i want to display the name of that colour than that of values.what i have to do?
If the red, green, and blue values are all 255, then the name of that color is white.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: If the red, green, and blue values are all 255, then the name of that color is white.
so, how could i solve my problem in order to display the name of the colour
on window
|
|
|
|
|
You have to do it yourself. As I said, there is no name associated with COLOURREF (it is just a number). If you have only Red (0x0000FF), Green (0x00FF00) and Blue (0xFF0000) you can check the color and display the name if it matches:
if (m_Colour&0x0000FF)
{
}
if (m_Colour&0x00FF00)
{
}
if (m_Colour&0xFF0000)
{
}
It's not very elegant but you requirement is... quite 'strange'
|
|
|
|
|
if( m_colour == GREEN )
{
str2 = "GREEN";
}
.. fill in the rest ..
pDC->TextOut(400,10,"COLOUR:"+str2);
|
|
|
|