|
hy!
I think there is a breakpoint set in your component ( i don'y know for sure because i never do vb programming ...;P )
Bye,
BogdanO
...the night is long ... but not long enought to do some real coding ...
|
|
|
|
|
I am trying to compare 2 colours having the COLORREF value, and specifying a tolerance, to decide if a pen of color 1 will be different enough to be visible if drawn on a background color 2.
Do you know of a reference where I my be able find information about this. I thought about using variation of the algorithm I have for finding the nearest color from a palette. However it is not working for me in trying to work out a reasonable value for 'dist' in the code below.
int blue = (GetRValue(dwColor) - GetRValue(sE->seRGB));
blue *= blue;
int green = (GetGValue(dwColor) - GetGValue(sE->seRGB));
green *= green;
int red = (GetBValue(dwColor) - GetBValue(sE->seRGB));
red *= red;
int dist = red + green + blue;
Happy programming!!
|
|
|
|
|
try using ABS so that red green and blue are always positive. Otherwise 0,0,255 and 255,0,0 will have a dist ==0, this way it would be 510.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
That's great
Thank you
Happy programming!!
|
|
|
|
|
As Tomaz pointed out, this was wrong, because you square the value and so a negative * a negative = a positive.
What may work for you is to look at a greyscale algorithm to get an idea of how the eye percieves blue, green and red (i.e. how strong each colour is ) and weight them accordingly.
I think you're going to have some trouble though - darker colours obviously need to be more distant from one another than lighter colours, and a greater weight distance in one colour will give better differentiation than the same distance spread over all three, for example.
How many colours do you need ?
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
The could be anything almost.
The software is for designing embroidery patterns, and in Cross stitch block mode I would like give an indication of the presence of a stitch even if the colours are close together. In real thing the eye would of course still see the stitch because of texture.
The result therefore does not have to be perfect but is intended to be a guide, and make previewing a little easier.
Happy programming!!
|
|
|
|
|
So you don't need a lot of colours, you're trying to show the stitch which will be a similar colour and want it to be visible ? You basically need to calculate a similar colour that will be visible ?
Why don't you do a 3D rect type thing ? Make the stitch visible by drawing in a lighter colour across one edge and darker across the other to give an illusion of depth, which is how the stitches will eventually be percieved ?
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
try using ABS so that red green and blue are always positive.
This will not change anything. red, green and blue are always positive - he's using square distance (without square root).
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Oh... that's what I get for not looking too closely. *sheepish grin*
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Hi... I'm wondering if there is a way to 1) figure out what the default web browser on a person's computer is and 2) open a HTML doc with it.
I want to put a website on a cd, and have the people pop it into their drive and have autoplay open the index for them... any help would be appriciated.
Thanks
|
|
|
|
|
::ShellExecute will do it for you if you pass in the html document path, by running it in the program associated with it.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
ow to get Windows Nt Server Information(such as user profiles,group, directory size , backups, mointoring etc.) using Visual C++ APIs
|
|
|
|
|
Much of that information is available in the Network Management Functions. NetUserGetGroups for example. If you have MSDN you can find them.
|
|
|
|
|
ow to get Windows Nt Server Information(such as user profiles,group, directory size , backups, mointoring etc.) using Visual C++ APIs
|
|
|
|
|
Hi there,
I am trying to add an icon to my Delete dialog box. I would like this
icon to be the same as the one microsoft uses in its Window 2000 Delete dialog boxes within its Windows Explorer.
How do I find this icon on my desktop programmatically? I have searched my directories but i can't find anything like it and I am not sure which exe i need to extract to retrieve this info from.
thanks
|
|
|
|
|
The easiest way is to rip it out of the system dlls. Chances are the icon you are looking for is in shell32.dll, but it may be in another. To find it, do a File->Open from Visual Studio and locate the dll you want to look at. At the bottom of the File Open dialog, there is a "Open As" combo - select Resources, and the resources of the dll you've selected should appear in Visual Studio. Browse at will.
Unfortunately, I don't have W2k installed at the moment, so I can't check what icon you need, but chances are it's in shell32.dll.
Hope this helps.
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
Hello all,
I'm looking at including an interpreted scripting language into my application. The major constraints are the following:
(1) It must be cross platform capable (Windows, Mac, maybe Unix).
(2) It must be relatively lightweight.
However, as I'm sure all such notions begin, "it doesn't need to do much" I saw the SAScript demo here (pretty helpful), but am looking for other options as well. Can anyone suggest what alternatives there are and/or places to look about how to roll your own? Any other info or tales of dread are welcome. Thanks.
|
|
|
|
|
We're just starting a new version of our product and cross platform is a major concern. Hence we moved from DX to OpenGL. We are also writing our own GUI classes in order to reimpliment them under other platforms, so our core code will be cross platform and we'll end up with a set of libraries for cross platform GUI development. We are scripting with Python and it's working very nicely. I've got a set of classes in C++ and a set of classes in Python that allow me in our Python console to create a GUI and link buttons, text events, etc. to Python code. All our 3D tools are also written in Python, linking back to the C++ code, of course.
I'm finding Python very easy to learn and use, very easy to set up and to link back to C++. Certainly I can promise if you decide to use Python there'll be at least one other CP'er in the trenches to offer war stories and support....
Christian
Secrets of a happy marriage #27:
Never go to bed if you are mad at each other. It's more fun to stay up and fight.
|
|
|
|
|
At least I know that I'll have someone to commiserate with
I've never used Python but have used Perl somewhat. It looks like you can do something similar with Perl too. Did you look at Perl as well and if so, what about Python made it the winner? Do you have any good links about embedding Python? Thanks Christian.
|
|
|
|
|
The guys here tell me we chose Python because object orientation is not a bolt on, and it looked nicer to impliment.
From the Python.org site, this is Perl vs. Python according to Yoda:
EXTERIOR: DAGOBAH -- DAY
With Yoda strapped to his back, Luke climbs up one of the
many thick vines that grow in the swamp until he reaches the
Dagobah statistics lab. Panting heavily, he continues his
exercises -- grepping, installing new packages, logging in as
root, and writing replacements for two-year-old shell scripts
in Python.
YODA: Code! Yes. A programmer's strength flows from code maintainability.
But beware of Perl. Terse syntax... more than one way to do it...
default variables. The dark side of code maintainability are they.
Easily they flow, quick to join you when code you write. If once
you start down the dark path, forever will it dominate your destiny,
consume you it will.
LUKE: Is Perl better than Python?
YODA: No... no... no. Quicker, easier, more seductive.
LUKE: But how will I know why Python is better than Perl?
YODA: You will know. When your code you try to read six months from
now.
They suggest you look at Ruby as well if you're examining options.
www.python.org is the site you want for Python info, including embedding information.
Here is a comparison of Python to other languages on that site.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
I just started developing ActiveX control with mfc. I have a property page with 2 edit fields. I know I can call my activeX control through object tag and CLASSID and it displays my control but I was wondering how can I call my property page over the web. On my property page I have CLASSID too and I tried using that but it didnt work. There is another tag <param /> but i dont know how it will call my property page to display on the webpage.
I am wondering if there is code which somehow links the control with the property page on the webpage. Since I have written everything in the Ppg.cpp itself, I really want to display my property page otherwise I will have to write everything in the ctrl.cpp like create a dialogbox within my ctrl.cpp file to handle everything.
Any help will be greatly appreciated..
Thanks in advance
Bobby
smile is the best medicine
|
|
|
|
|
guess what I found it..u cant display property page on a web page...propery page just lists the properties which u can modify through scripts..
Cheers
Bobby ;P
|
|
|
|
|
I have a program that runs in the system tray, and when i send a message to the program i want to a popbox showup like MSN Messenger. Or if nobody knows
how to do that, could anybody tell how to have my dialog box show in the bottom right corner. No matter what resolution the user running. Sorry for such a big question
Thanks,
Caleb
|
|
|
|
|
well to have your window popup just handle the message and do:
ShowWindow(SW_RESTORE);
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
im looking for some implementations of some vb string functions, mainly left() and right(). can anybody show me?
|
|
|
|