|
Good day
Im tring to uninstall an application using command prompt. After it has uninstalled, it must not show on the Add/Remove Programs folder. Can anyone help me.
Thank you in advance
Kulile --- RSA
|
|
|
|
|
Is there a way to center text in a message box? Its left aligning it and Id rather have it centered if there is a way.
|
|
|
|
|
The text must be centered if the box grows to fit the text
You can use \n if you want CR's and manually "box" lengthy text that way.
Glen Harvy
|
|
|
|
|
Hi Guys,
I’m creating an animation program and have built a Bezier spline motion editor. The user-controllable curve plots time(x) against value(y). So my challenge is to retrieve the 'y' value from a given 'x' on the curve. However, all the articles I've been able to find/understand only give a formula for calculating an x or y from 't' - the percentage along the given cubic bezier curve.
As 't' is more concentrated around areas which heavily curve (to make a smooth curve), it's not possible to calculate y from x. So I'm using what seems to be a recognised work around and iteratively guessing at which 't' value produces x, continually reducing the difference until I find the correct 't' which produces my required x. I then use this 't' to calculate y.
This all works perfectly well. However, this is an animation program so I need to optimize this process. My current technique requires up to 15 iterations before it finds an accurate value for 't'. I found an article online by Don Lanaster, “Some more cubic spline math BEZMATH.PS”. He mentions using the Newton-Raphelson method to reduce this process down to 3 iterations. Apparently this technique uses the slope of the curve to make the approximation of 't' more accurate. However, the formula he uses doesn't match the formula I currently have working to calculate a value on the curve. I'm sure I'm misunderstanding it!
At this point I have to confess I am a Math dummy. I can work my way around practical mathematical issues as long as I don’t have to resort to long formulas full of ancient Greek!
Here's an extract from Don's article:
--- Quote ----
Let's use a better ploy to get our approximation to close quickly. It is called the NEWTON-RAPHELSON method, but is much simpler than it sounds. Say we get an error of x - x1. x1 is the current x for our current guess. At x1, our spline curve has a slope. Find the slope.
The slope is expressed as rise/run. Now, on any triangle...
rise = run x (rise/run)
This gives us a very good improvement for our next approximation. It turns out that the "adjust for slope" method converges very rapidly. Three passes are usually good enough. If our curve has an equation of...
x = At^3 + Bt^2 + Ct + D
...its slope will be...
x' = 3At^2 +2Bt + C
And the dt/dx slope will be its inverse or 1/(3At^2 + 2Bt +C). This is easily calculated. The next guess will be...
nextguess = currentt + (curentx - x)(currentslope)
----- end quote ----
So here's the function I call iteratively with varying values for 't' and it returns 'x' for me to compare with what I want:
public float CalcBezierValue(float t, float A, float B, float C, float D)
{
t = 1 - t; // Reverse the normalised percentage
float F1 = t * t * t; // These vars used purely for visual clarity
float F2 = 3 * t * t * (1 - t);
float F3 = 3 * P * (1 - t) * (1 - t);
float F4 = (1 - t) * (1 - t) * (1 - t);
return A * F1 + B * F2 + C * F3 + D * F4;
}
As you can see the base formula which produces the return value is quite different from the one in the article (x = At^3 + Bt^2 + Ct + D). Consequently I’m failing to comprehend how to calculate the slope value or its inverse which seem to be required to reduce the number of calls to this function.
Can anyone help me?
Many thanks for your time,
Simon
-- modified at 12:02 Wednesday 13th September, 2006
|
|
|
|
|
You choose wrrong forum brother try it in google groups but math
when i want to read something good just seat and type it
|
|
|
|
|
Thanks for the tip. I've posted on there too.
|
|
|
|
|
|
There is a Maths forum here as well.
As of how to accomplish this, have you ever tried Google? Failing that try
|
|
|
|
|
Guys,
Thanks so much for everyone's feedback. From all the feedback on this and other forums I have the answer.
The function CalcBezierValue() computes the cubic Bézier curve as the polynomial:
x = A*t^3 + 3*B*(t^2)*(1-t) + 3*C*t*(1-t)^2 + D*(1-t)^3
To use the technique in the article I need the derivative:
x' = 3*A*t^2 + 6*B*t*(1-t) - 3*B*t^2 + 3*C*(1-t)^2 - 6*C*t*(1-t) - 3*D*(1-t)^2
The final code looks like this:
// Calc the derivative value of the curve at the specified percentage (rather than the polynomial)
public float CalcBezierDerivative(float P, float A, float B, float C, float D)
{
P = 1 - P; // Reverse the normalised percentage
float tR = 3 * A * (P * P);
float tS = 6 * B * P * (1 - P);
float tT = 3 * B * (P * P);
float tU = 3 * C * ((1 - P) * (1 - P));
float tV = 6 * C * P * (1 - P);
float tW = 3 * D * ((1 - P) * (1 - P));
return tR + tS - tT + tU - tV - tW;
}
Many thanks for all your responses.
Simon
|
|
|
|
|
i want to implement zoomin opertion in C# for that i used picturebox control which is contained in a panel control but in mouse click event of picturebox i just increased the height and width of the picturebox so its just moving right even i set the autoscroll of panel control and its autoscrollposition to point containing e.x,e.y but its not working perfectly.
so now i want to position the picturebox image where i clicked, after the zooming effect applied the zoomed area should be shown so pls if any body knows help me or otherwise is there any method to implement zoom operations with the controls i used or with any other way pls help that is important and urgent.
thanx in advance.
|
|
|
|
|
Hello
1- Take the X, and Y coordinates in the MouseUP event handler relative top the current width, and height of your picturebox
2- use a graphics object to scale the image, ie. mygraphics.ScaleTransform() giving the X, and Y zooming factors.
3- Use the same Graphics object to draw the image to the picturebox.image.
Regards
|
|
|
|
|
thanx for u r response, i tried what ever u sent but it didn't work. I don't know why image is remain same after writing the code in mouseup event of picturebox also, and i have one more doubt that the control used in some applications and elsewhere to perform zoom operations is picturebox or anything else ? but pls help me to perform the zoomoperations
thanks once again in advance.
|
|
|
|
|
kalaveer wrote: I don't know why image is remain same after writing the code in mouseup event of picturebox also
Posting that code will do a great help in debugging it!!
kalaveer wrote: i have one more doubt that the control used in some applications and elsewhere to perform zoom operations is picturebox or anything else ?
Well, each applications implements zooming the way that suits the dev team. You want to make a custom control and do all the code yourself, it should be much better, but will take way much more time and efoort. What I provided to you was the simplest way to make zooming works. More advanced ways are provided in articles not forums.
Regards
|
|
|
|
|
Hello,
i have two treeViews. treeView1 and treeView2.
I want to copy (the nodes) from treeView2 into treeView1... (treeView1 = treeView2)it happen also...
But, i see nothing in my treeView1....
what do I have to make?
thx i-p-g-i
|
|
|
|
|
how do u fill treeview2?? (from database ,xml???)
suggestion:
While u fill treeview2 at same time fill treeview1 with same nodes which u fill treeview2
|
|
|
|
|
// fill the TreeView (TreeView2 is public)
for (int i....)
{
treeview2.Nodes.Add(myObject.returnString)
}
TreeView treeView1 = new TreeView();
treeView1 = TreeView2;
treeView1.Refresh();
...
But I see Nothing in treeView1... but in the monitoring nodes are present...
|
|
|
|
|
TreeView treeView1 = new TreeView();<br />
for (int i....)<br />
{<br />
treeview2.Nodes.Add(myObject.returnString);<br />
treeview1.Nodes.Add(myObject.returnString);<br />
}
|
|
|
|
|
Was well meant of you...
I habe buid my own class with an collection of Nodes...
Thanks for the assistance...
|
|
|
|
|
It's my pleasure...
U are welcome...
|
|
|
|
|
Hi Everyone,
I have searched and searched and I cannot find what I am looking for .. It is probably because I do not know the proper terminology of what I am trying to do.
I have a program that I created that does operations on ZIP files. I want to be able to be browsing my folders w/ Explorer and right click on the file, and have my application come up as a handler. (Like WinZip, you right click on a .ZIP file and WinZIP appears on the menu with some options , extract to, add to zip, etc). I want my program to have a place on that system menu that will say "Open with myprogram", and have Explorer open up my program and pass the name of the file to it.
Can someone point me in the right direction , please I would really appreciate it!
Thanks
|
|
|
|
|
Those are called "Shell Extensions". There are several articles here on Code Project about them.
led mike
|
|
|
|
|
Hi all, I am trying to capture sound from the microphone and send it over the network as a PDU to an ASTi radio. I can capture the sound once and when I send it over the network it sounds horrible. I think the problem could be because I am capturing the audio as a wave formatted audio. Is there anyway to capture audio from a microphone using say ULaw encoding or some raw buffer like that?
Thanks
|
|
|
|
|
Does anyone have an example of how to read the Height and Width of a JPG file
using .NET and c# BUT without loading the image into memory?
I have seen examples in C++ but have failed to translate the code. I know I
need to read the binary file stream and look for the headers but have still
got problems doing this.
Any help would be much appreciated.
Regards
Richard
|
|
|
|
|
Hello
Ach1lles wrote: I have seen examples in C++
You can use those C++ functions from your C# code using P/Invoke. You don't have to translate it.
Regards
|
|
|
|
|
I need to launch a ClickOnce application from another application. Any ideas on how I could do this? I don't really want to use a whole webbrowser control etc. and navigate to the URL.
|
|
|
|