|
I want to remove the menu attached to my mdi application. Also i want my mainfram as well as childframe maximised along with this. How to get this?
Pls help
vini
|
|
|
|
|
Hi,
I have two RGB values of same color, one is lighter and the other is darker. E.g., (107,113,181) and (74,85,132)
How could I judge they are same color by an algorithm?
Thanks.
Shawn Liu
|
|
|
|
|
What is to be considered "the same color" is a fuzzy question, but you might find some approaches good for your needs. RGB triplets can be mapped to a different colorspace called HSV (Hue, Saturation and Value). From a physiological point of view, hue seems to capture well what humans perceive as "color", while saturation and value account for "brightness" and "luminosity", so to say.
H ranges between 0 and 360 degrees, and it is to be seen as "circular", i.e. 0=360.
So, you can calculate the H component for two RGB triplets and apply some distance criterion to determine whether they are the same color or not. Follow this link for a RGB to HSV routine in C. Hue values for the RGB triplets in your post are 235 and 229, respectively.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Purely conjecture, but wouldnt the easiest way be simply subtract each value from the triplet from its corresponding value from the other triplet.
For example:
RGB(107,113,181)
and
RGB(87,93,161)
and the differences are
(20,20,20)
are the same colour, but the top one is lighter. You could have a margin of error, whereby the differences must be within 10 of each other for example.
--
David Wengier
TAC ad gone wrong: "Don't fool yourself, you're a bloody idiot."
Sonork ID: 100.14177 - Ch00k
|
|
|
|
|
Well, no conclusive answer can be drawn about a psychovisual subject, but this measure of similarity seems very inaccurate to me, as it fails to identify RGB(128,0,0) and RGB(255,0,0) as the same color (both are pure red): differences are 128, 0 and 0, which are not within 10 of each other.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I didnt think of that
--
David Wengier
TAC ad gone wrong: "Don't fool yourself, you're a bloody idiot."
Sonork ID: 100.14177 - Ch00k
|
|
|
|
|
In RGB color, where 0 represents that channel OFF, and 255 represents that channel ON:
The relative intensity of each channel represents the overall color.
Therefore, (0,0,0) and (255,255,255) are the same color, one being quite a dark shade and one being a bright shade.
Therefore, treat the RGB triple as a 3-way ratio or fraction (R:G:B). if the ratio is the same, then they are the same color.
Jon
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Hi all,
I have a CByteArray that is holding a bunch of 8 bit values. I'm getting the Hexadecimal values into the array from a device on the com port.
What i want to do is save these values as they are into a file. The hex values I have received are actually ascii characters (eg. 0x41 == 65 decimal == 'A') so I want to be able to save it as a file so when opened with notepad or something the ascii characters are there?
I was thinking that the serialize functions might be needed but I'm not entirely sure as it looks like it writes the file to an archive. What would be the best method to approach this??
Thanks
-Mark
|
|
|
|
|
The CByteArray class has a GetData function which should do the trick:
CFile vfFile;
CByteArray varrStuff;
DWORD vdwLen;
vdwLen = varrStuff.GetSize();
vfFile.Open(_T("dump_me.txt"), CFile::modeCreate | CFile::modeWrite | CFile::shareDenyWrite);
vfFile.Write(varrStuff.GetData(), vdwLen);
vfFile.Close();
Hope this helps.
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
Hi, Gurus
I am currently working on Excel Automation Project. I was just wondering if there is any
way to handle Microsoft Excel's menu bar in my
own dialog-based project. For example, if I press
the FILE button on my own project, I want the same event as File menu button has been presssed.
Any ideas?
|
|
|
|
|
Use the excel application inteface methods to perform the same actions as those on the menu.
e.g.
Implement Save on the File menu with
OnFileSave()
{
pWorkbook->Save();
}
where pWorkbook is a pointer to the workbook interface.
|
|
|
|
|
Thanks for the reply... I appreciate it although I expected
slightly different answer. If you open the MICROSOFT EXCEL
program, you can see the menu bar (File,Edit, View, Insert and so
on..)I want to have those specific menu clicked on my application.
You were talking about submenus. Any idea?
|
|
|
|
|
Sorry, I misunderstood you. Thought you wanted to go the other way. I don't think you can do what you're asking about.
|
|
|
|
|
Any Menu or Submenu is linked with Macros.
You need to use
Workspece-><macroname><code><br />
For example<br />
<pre>
hr = IWorkspace->SaveAs();
</pre><br />
<br />
Best Regards.... <br />
<br />
Carlos Antollini.<br />
<a href="http://www.sonork.com/">Sonork</a> ID 100.10529 cantollini
|
|
|
|
|
Hi there,
I have read bits and pieces of at least half a dozen C/C++ related books...anything from Deittel &Deittel, Jeff Prosise's MFC book, Charles Petzold's Win32 book, and books top 50 tips for C++ and others...However, I like to get a better understanding of C++ compilers/linkers and how they deal with stuff...for instance, why do you have set various options in Visual C++ in order to accomplish certain things and others...so, essentially something deep and hopefully platform independent...any suggestions?
|
|
|
|
|
Further to my post, just to clarify a bit..for instance, I want to see how a compiler deals with a case of forward declaration as opposed to header inclusion, or a case of dynamic_cast when the /Gy option is set in Visual C++ for instance or in other C compilers with their respective options and or even stuff like how a function declaration is defined in memory...
|
|
|
|
|
|
I'm tired and I don't know if i'm reading right, but it sounds like you want to know why VC++ works the way it does and C++ at the same time. Yet you also say you would like platform independance...???
That kind of book I am not aware of...Usually they cater to one or the other, but not both...that'd be a pretty big book.
Anyways...if you want an excellent book, "Thinking in C++ by Bruce"....shite I can't remember his name...but if you search around on google his second edition is availble online.
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
It's Bruce Eckel. However, Bruce's book are plain vanilla C++ and Java and are more about how to propertly design and code applications using a given language. Therefore, unless I'm misunderstanding the original poster's query it's not what he's asking for, which is a book about a specific compiler.
Cheers,
Tom Archer
Author, Inside C#
|
|
|
|
|
Tom Archer wrote:
It's Bruce Eckel.
Thats it...couldn't remember his last name and i'm too lazy to dig through all my books to find just his full name.
Tom Archer wrote:
However, Bruce's book are plain vanilla C++ and Java
I have a hard copy of the first version and don't recall anything Java...is it really in there? I've only breifly glanced over the 2nd version, cuz most of it was a repeat of the first.
The impression I got from the original post was not clear...I didn't quite understand...basically I thought he was looking for a good platform independent type book. Bruce's book covers draft ANSI/ISO C++ which I thought was pretty platform independant. Plus IMO his book is the best i've ever read concerning C++.
In anycase the original post IMO wasn't very clear so I answered in a way I thought acceptable.
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
>>>
I have a hard copy of the first version and don't recall anything Java...is it really in there? I've only breifly glanced over the 2nd version, cuz most of it was a repeat of the first.
<<<
He also wrote 'Thinking in Java'
>>>
The impression I got from the original post was not clear...
<<<
I could be wrong on the "specific to VC++" bit. However, I know that Bruce doesn't get into compiler options, which was one of the things the original poster was curious about.
>>>
In anycase the original post IMO wasn't very clear so I answered in a way I thought acceptable.
<<<
No problem. Heck, I could be the one misinterpreting the whole thing Wouldn't be the first time
Cheers,
Tom Archer
Author, Inside C#
|
|
|
|
|
Unfortunately I don't believe such a book exists. I think the closes thing you're going to get is are books that focus on illustrating how to write compilers. However, this is probably overkill for what you're looking for.
Cheers,
Tom Archer
Author, Inside C#
|
|
|
|
|
Has anyone come across code for a file/folder selector dialog?
I want to mimic the standard file open dialog, but want to also allow the user to end the dialog by simply selecting a folder. If I came across a tree combo box that displayed the shell's folder hierarchy, I'd craft the dialog myself. Imho, the hard part is implementing the tree combo.
Thanks,
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I normally don't like giving codeguru links but there are a bunch on codeguru on of them :-
http://www.codeguru.com/dialog/DirDialogPhillips.shtml
|
|
|
|
|
Thanks Rama! The sample was extremely close to what I wanted. Here's a link (an article by none other than good old PJL) that implements it completely:
http://msdn.microsoft.com/msdnmag/issues/02/01/c/c0201.asp
Thanks again!
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|