|
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.
|
|
|
|
|
C:\\Documents and Settings\\LOGGEDINUSERNAME\\Start Menu\\Programs\\ApplicationName.appref-ms
|
|
|
|
|
Data hiding is just a means by which one hides away data from the external world... example, the lungs of a person is not seen by anyone, but used for the internal working of the human being!
Data Encapusation allows to package all the contents of the object. They may or may not be public to the external world. Example, the skin is part of the human, and so is the lung. Together all the components of the human make up one whole being!
And finally Data Abstraction is the means by which one displays only what is required to the user. Sample - the mood of a person to a girl, a snake, a cat, a father, or a boss. Though they are all emotions, they differ based on the stimuli, and hence a portion of the whole is displayed to the person who requests it.
Thanks to my friend (P.J Lionel) - Shanu
|
|
|
|
|
|
Dear friends,
Pl, Show the Inhnacements in VS.net 2005 over 2003. If on this site or elsewhere it is shown already Pl give the link. I tried on codeproject and don't find either. May be it is on with some other keywords.
with Regrads
Dev
|
|
|
|
|
Search the microsoft website.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
I am using the DataGridView control in a WinForm. (Visual Studio 2005)
One of the columns is of this type:
DataGridViewComboBoxColumn
cbo = new DataGridViewComboBoxColumn();
cbo.DataSource = dt; //DataTable
cbo.DisplayMember = "User";
cbo.ValueMember = "IDUser";
dataGridView1.Columns.Insert(0, cbo);
Now, How to I can access to the properties of each comboBox? (SelectIndex, SelectValue, SelectText, ...)
The FindControl() method is only available in web applications.
Thanks and sorry for my english.
|
|
|
|
|
Its for my AR DS code editor, i need to open an XML (or TXT) file thats on the internet, but i havn't done anything with the internet in C# yet, so i have no idea what to do
|
|
|
|