|
|
Maybe it doesn't like it when you put questions into unrelated questions.
|
|
|
|
|
Hi all,
I have to make a library to convert the Color from Lab value to RGB value. However, it requires an algorithms to do so.
I read some documents, it mentioned that the steps should be
1. Lab -> XYZ
2. XYZ -> RGB
I really have no idea what the calculation should be.
I hope to fine some example from here, as I think some of the experts
must have done the same things, or have this experience.
Could you please provide me some examples? Thanks Thanks ...
|
|
|
|
|
Hi,
hope this can help you..
Link[^]
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
|
Can someone share me some example programe code for this?
I need it urgently... >_<
|
|
|
|
|
Maybe this CodeProject article[^] will help.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
I am trying to call the following method from a library to an exe file using a delegate, can anyone help with the following:
namespace xxx
{
public delegate void DelegateGetMethodA(Int32 b);
class Library1
{
MethodA() // How do I call MethodA here using delegates
}
}
namespace xxx
{
static class Program
{
[STAThread]
public static void Main()
{
ExecutionClass exe = new ExecutionClass();
DelegateGetMethodA GetMethodA = new DelegateGetMethodA(exe.MethodA);
}
}
}
namespace xxx
{
class ExecutionClass
{
void MethodA(Int32 b)
{
a = b + c;
}
}
}
Thanks in advance,
Michael
|
|
|
|
|
create an instance of the delegate
like
DelegateGetMethodA _delegateGetMethodA = null; in the class where you want to invok the method.
Then set the method to the delegate
Library1 _library = new Library1();
_library.SetDelegate(exe.MethodA);
In the SetDelegate methods assign the value to the _delegateGetMethodA
Then you can call the delegate
_delegateGetMethodA (parameters);
Sudeesh
|
|
|
|
|
Hi Guys.
I have been trying to make the following happens, but as a newbe to c# I beleive I need some help out there.
I made a (C# :: MDI Application) , as we call it in delphi, that creates a child with a blank white image on it.
What I need to do is to create an image(a small image that differs from that big white one), every time the user clicks on the first big white image, and put this small image on the position of mouse clicking...
Here the program must store the names and positions of those small images in an array, and update this array every time the user moves one of the small images....
Does any one know how to make this work...
Any Thoughts could Help..
Thanks in advance.
|
|
|
|
|
Yes, create a class, inherit System.Control. Overide the OnPaint, OnPaintBackground, and OnClick OnMouseMove events. Add code as necessary.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Dear Sir,
Forgive my ignorance, but as I said in my question, 'I used to be a delphi guy, I am just a newbe to c#'.
Based on this fact I really can't see or know how to use the tips you mentioned.
Could you be more specific please. I am quiet sure that you have the answer for my question<<MY HUGE TROUBLE>>
Thanks a lot for your patience and understanding..
|
|
|
|
|
Beyond pointing you in the right direction there is not much else I can do beside writing the application. I would recommend a good thick book on C# and then you will be able to use the MSDN reference to get the immediate answers.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Dear Sir,
I thought you would say something like this.
And I would like to thank you for your patience.
I am already surfing in a HUGE book on c#, and all I wanted is a little help on starting.
Again.
Thanks so much ...
|
|
|
|
|
I have a question for all the experts here.
In visual studio, I find a lot of tools that help you. For Example Gridview, you can use the SqlDataSource to do all your Select, Insert, Update, Delete functions.
So what is recommended? write your own code in different classes and methods or use these tools?
My personnal opinion is that the wizard clutters up the aspx page, while your code reside in aspx.cs which is neater.
But of course wizard is faster and more convenient.
So what do you advise?
|
|
|
|
|
The wizard is also less effort, and probably less effort to run again when your schema changes.
If you are worried about tools making your life too easy then use notepad
|
|
|
|
|
I agree it is less effort to create, but for troubleshooting and modifications, it will be difficult as all the fragments are either hidden or distributed....
If we were writing codes...all the logic, data access methods will be clustered together.
this will mean easier to find the problems if any.
Right?
|
|
|
|
|
Theres good and bad code generators. A large majority of code generators just spit out a whole bunch of inflexible templated crap, and its impossible to build on what they give you.
Decent tools can do a little bit of code-generation in such a way that things don't break. A good example is the forms designer - that adds extra stuff in a partial class behind the scenes. Our tools do a similar approach on data classes. The main point is that the tools can be run again at any time to cope with say a new button on a form, or a new field in a database - without breaking any existing modifications.
The only thing to be wary of is that it does generally force you to keep using the same tool - or maintain the generated code by hand. Stuff thats built into Visual Studio is obviously still going to be there - but you probably should also lean towards picking tools which give the same functionality with less code-gen.
|
|
|
|
|
hello
i hav developed an application in whose database i have saved the hashcode for the password string... Now the problem is that my client changed the password and now has forgotten the password ... N now i have to somehow unlock my application... All i did was changed the input password string into the resulting hashcode and saved it in the db.. now i have the hashcode but cant reverse it to get the original string
Please provide help on how i can trace back the password
haseeb
|
|
|
|
|
haseeb_saeed wrote: my client changed the password and now has forgotten the password
Are you talking about a cryptographic hash? If so, then you can't retrieve the password from the hash. That's the whole point of cryptographic hashing - it's a 1 way process. I suggest you read this article[^] to gain a better understanding of the subject.
If you are hashing passwords, your application should offer a user the means to reset their password if they have forgotten it. Typically you would ask the user to identify themselves, for instance by answering a personal question that only they would know the answer to. You could consider encrypting the password instead so it could be retrieved. However then you have the issue of securing the encryption key. Hashing passwords is, in my opinion, the preferred approach.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
There are two ways:
1. Examine the algorithm used to create the hash code so that you can invent a way of calculating the shortest possible strings that result in a specific hash code.
2. Loop through all possible combinations of characters and create a hash code from them and compare to the stored hash code.
Neither of these are easy or fast. The purpose of hashing the passwords is that it should not be possible to recreate them.
Just give your client a new password.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Create a new password, hash it using the method in the application and then insert it into the field.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
I have an application where I use the web browser control and allow JScript to interact with my application though the object for scripting class that is set to com visible.
I've been looking around the and I can't seem to find the limits of what data types/object you can pass to and from JScript. I know the basics work like int, float, string, ect...
But I'd like to pass XML directly, but not as text due to the overhead of phrasing it. So does anyone know the limits or where to find out more information about the C# to JScript COM interop though the web browser control?
I know the following works:
public string feedJScriptXML()
{
XmlDocument myXMLDoc = new XmlDocument();
myXMLDoc.Load("C:\myXMLfile.xml");
return myXMLDoc.OuterXml;
}
Then send it as text to JScript and use it in JScript by
function readCsharpXML()
{
var xmlString = window.external.feedJScriptXML();
var theXML = new ActiveXObject("Microsoft.XMLDOM");
theXML.load(xmlString);
}
The above is 100x better than writing the XML to a file and then reading the file into JScript... I think it might be better if I could dump the XML document into the JScript directly to save the extra phrase time... This application needs to read the XML 100's of times a minute so every little bit helps...
The only information I've found on this is very basic via the MSDN C# tutorials http://msdn2.microsoft.com/en-us/vcsharp/bb798044.aspx?wt.slv=RightRail[^]
and the WebBrowser.ObjectForScripting information at MSDN: http://msdn2.microsoft.com/en-us/library/system.windows.forms.webbrowser.objectforscripting(VS.80).aspx[^]
|
|
|
|
|
I doubt you can return a .NET XmlDocument to Javascript but you might be able to return an MSXML interface. Of course then you don't have the simplicity of using XmlDocument in your C# code so I don't know if that is of any benefit.
SpacixOne wrote: but not as text due to the overhead of phrasing it.
you mean parsing it I guess. Are you sure the overhead is significant to warrant consideration? Also I have no idea what you are going to do with it in the javascript but I seems likely you want to copy some values from the XML into HTML elements for display etc. Can't you just do that using the DHTML interface from the C# code directly?
Also when it comes to altering a HTML display in an embedded browser control you can generate the HTML using XML/XSLT transformation and then use one DHTML call to transfer the results into the browser document rather than using DHTML to access each discrete HTML element.
led mike
|
|
|
|
|
led mike wrote: Also when it comes to altering a HTML display in an embedded browser control you can generate the HTML using XML/XSLT transformation and then use one DHTML call to transfer the results into the browser document rather than using DHTML to access each discrete HTML element.
So you mean just write the whole page out to an XML file instead of just the data... I never thought about doing it that way... crap wish I we thought something along these lines a few weeks back (or posted it on here to get your comment back then) as that might have been easier in the long run.
Currently to far along to change that much though
Right now I'm just setting it up so there is an easy to configure display (IE HTML display) that allows to see the data that is saved via XML for web posting.
led mike wrote: I doubt you can return a .NET XmlDocument to Javascript but you might be able to return an MSXML interface. Of course then you don't have the simplicity of using XmlDocument in your C# code so I don't know if that is of any benefit.
Wonder how hard that would be to write a convert function, yet though converting it would still have the extra step and might not be much a benefit at all... Sounds like I may end up on worth than failure heh
|
|
|
|