How to implement a cool smooth curve control like this?

Hi,

I'd like to implement a curve control as shown in the below URL:

http://www.sunlitgreen.com/screenshots/images/SGPE_screenshot_03.jpg

It's cool and I like it so much.

Any idea how to implement such a "smooth curve" control? Thanks.
0
12/14/2007 9:05:48 AM
vc.mfc 33608 articles. 0 followers. Follow

6 Replies
677 Views

Similar Articles

[PageSpeed] 59

"Aved" <avedrinker@gmail.com> wrote in message 
news:c0298275-d4a8-4dac-851e-9ed882671e85@s8g2000prg.googlegroups.com...

> Hi,
>
> I'd like to implement a curve control as shown in the below URL:
>
> http://www.sunlitgreen.com/screenshots/images/SGPE_screenshot_03.jpg
>
> It's cool and I like it so much.
>
> Any idea how to implement such a "smooth curve" control? Thanks.

There are a number of ways, but I'd guess the most popular way is with with 
piecewise Bezier curves, (Bezier splines),  for which Windows provides quite 
a bit of support.  But I guess you'd have to research the nature of Bezier 
curves an the way they work, in order to be able to make good use of them, 
and that does involve a little bit of mathematics.   Wikipedia has an 
introduction - the ones you want are "cubic Bezier curves".

Dave
-- 
David Webber
Author of 'Mozart the Music Processor'
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mozartists/mailinglist.htm

0
dave9996 (486)
12/14/2007 9:14:58 AM
"Aved" <avedrinker@gmail.com> ha scritto nel messaggio 
news:c0298275-d4a8-4dac-851e-9ed882671e85@s8g2000prg.googlegroups.com...

> I'd like to implement a curve control as shown in the below URL:

You may find the following CodeProject article to be interesting:

"An MFC Curve Control"
by Sunjoy Chen

http://www.codeproject.com/KB/miscctrl/curvectrl.aspx?df=100&forumid=136487&exp=0&select=998893

Giovanni


0
12/14/2007 9:16:38 AM
> I'd like to implement a curve control as shown in the below URL:
....
> Any idea how to implement such a "smooth curve" control? Thanks.
Check PolyBezier (http://msdn2.microsoft.com/en-us/library/ms534244.aspx)
and PolyBezierTo (http://msdn2.microsoft.com/en-us/library/ms534265.aspx)

-- 
Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
0
12/14/2007 9:16:50 AM
> There are a number of ways, but I'd guess the most popular way is with with
> piecewise Bezier curves, (Bezier splines),  for which Windows provides quite
> a bit of support.  But I guess you'd have to research the nature of Bezier
> curves an the way they work, in order to be able to make good use of them,
> and that does involve a little bit of mathematics.   Wikipedia has an
> introduction - the ones you want are "cubic Bezier curves".
>
> Dave
> --
> David Webber
> Author of 'Mozart the Music Processor'http://www.mozart.co.uk
> For discussion/support seehttp://www.mozart.co.uk/mozartists/mailinglist.htm

Thanks.

But we need additional off-curve control points for manipulating a
Bezier curve.
As we see, we never need off-curve control points for a curve as
shown.
0
12/14/2007 9:32:57 AM
> You may find the following CodeProject article to be interesting:
>
> "An MFC Curve Control"
> by Sunjoy Chen
>
> http://www.codeproject.com/KB/miscctrl/curvectrl.aspx?df=100&forumid=...
>
> Giovanni

Thanks for the information.
0
12/14/2007 9:35:01 AM
"Aved" <avedrinker@gmail.com> wrote in message 
news:697b08c5-a9c7-458f-a6a7-466f2a9c68fd@i12g2000prf.googlegroups.com...

> Thanks.
>
> But we need additional off-curve control points for manipulating a
> Bezier curve.
> As we see, we never need off-curve control points for a curve as
> shown.

Specifying the "off curve points" (control points) determines the gradient 
of the curve at each end, and if you do it right it ensures that the spline 
will be very smooth.    The direction of the curve at the end is from the 
end point to the appropriate control point.   [The distance of the control 
point from the end point controls (broadly speaking) how sharply the curve 
changes.]   It is just a mathematical transformation - there is nothing 
sinister about the control points.

Dave
-- 
David Webber
Author of 'Mozart the Music Processor'
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mozartists/mailinglist.htm

0
dave9996 (486)
12/14/2007 5:37:25 PM
Reply:

Similar Artilces:

Best way to embed a splitter control in a CpropertyPage?
Can someone point me in the right direction on this? I have a client that wants this kind of UI: 1) UI is property sheet containing an a number of tabs. 2) Each tab's CPropertySheet contains a static splitter. 3) Left pane on splitter is derived from a CFormView and contains a tree control. 4) Right pane contains something based upon a CFormView, dynamically replaceable depending upon what is selected in the tree control I have requirement 4 done and that's no problem. My CSplitterWnd implementation leaves a *lot* to be desired and that's where I need a nudge in the right dir...

#Name? error in calculated Controls
Hi - I'm having a difficult time figuring out why I am getting the error #Name? in all calculated fields on my report. I have verified that the name of the control is not used in the expression and that there are no erroneous spaces in my expression. The expressions I'm using vary from iif statements to basic arithmetic of two other fields e.g. =[Reimbursement]+[Ineligible] and =IIf([claims]>0,IIf([Total_claims]-[ded]>0,[Total_claims]-[ded]- ([Total_claims]-[ded]-[claims]),0),0) What may be causing these errors? Thanks David When I receive the "#Name?" in a con...

How can I control windows from access
I have an access database that is accessed by few users from different computers. I was requested to change the behavior of the database if it was opened on one particular computer to do the following: 1) disable the "Alt-Tab", and "Ctrl-Alt-Delete" buttons so that no one on that machine can go to the desktop 2) no minimizing of the screens is allowed i.e. the forms should always be maximized. 3) the main menu should always be on, and the only way to get out is by clicking the start button on the bottom of the screen to shut down. Is there away to do that? and can I...

Manipulating controls on Dlg Box before displaying, and making modal
Hi all. I'm trying to manipulate CStatic controls within a CDialog window, and diplay the results within a Modal window (in essence, I'm creating my own MessageBox). How do I make this window Modal once I've created it? My code: void CBenchmarkApp::OnImageProperties() //This window is to display image properties { LPCTSTR lpszText_Type; //pointer to constant character string lpszText_Type = "Test"; CWnd* pCWnd = AfxGetMainWnd(); //pointer to CChildView CImageProperties iprop(pCWnd); //Construct iprop object from CImageProperties class iprop.Create(IDD_Image_Properties,N...

Tab Control message handler ?
This is for a dialog-based program. And the code below is a TCN_SELCHANGE message handler for a Tab Control . I am not using a derived class. So, this handler function is in the main dialog class. And the problem is, I am not sure how to write the pointer statements for the "ShowWindow" function calls. Since it is not a member function of CTabCtrl, I am not sure how to write these lines. And it is a member of CWnd. void CTabDemoDlg::OnSelchangeTab(NMHDR* pNMHDR, LRESULT* pResult) { static int nOldTab; int nNewTab = m_cTabCtrl.GetCurSel(); if(nOldTab != nNewTab) { sw...

Date Time Picker control resizing
Hi, I have custom task form with some data fields using the Date Time Picker control. Sometimes, when I click on the drop down in the Date Time Picker to choose a date, the mini calendar becomes really big. If I get out of Outlook and try again sometimes its back to normal other times its can be very big or very small. I'm talking about the actual mini calendar when you click on the drop arrow and not the date field itself. Any help would be great. Thanks That's a known issue with the date picker control. You need code in your Item_Open event handler to size the control as ...

Is the check code necessory in control event function?
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com: 80/support/kb/articles/q180/3/66.asp&NoWebContent=1 From the above article, I learned how to add function to answer for control event. But the implementation of the function, OnDocumentComplete, puzzled me. Is the following code necessory? Why? { IUnknown* pUnk; LPDISPATCH lpWBDisp; HRESULT hr; pUnk = m_webBrowser.GetControlUnknown(); ASSERT(pUnk); hr = pUnk->QueryInterface(IID_IDispatch, (void**)&lpWBDisp); ASSERT(SUCCEEDED(hr)); if (lpDisp == lpWBDisp ) { // Top-l...

How do I create a CCheckListBox control with a dialog resource tem
I want to insert a Checklistbox into my dialog, but there is no tool for it in the standard toolbar. All the information that I have found so far tell sme that I can add one into the resource template, but does not mention how. Any help greatly appreciated! Mkennedy1102 wrote: > I want to insert a Checklistbox into my dialog, but there is no tool for it > in the standard toolbar. All the information that I have found so far tell > sme that I can add one into the resource template, but does not mention how. > Any help greatly appreciated! CCheckListBox uses an ordinary l...

debugging error message: security setting prohibit running Active X controls
Please help me. I have a window appearing all the time when I open up a new e-mail message to send to someone after I went and got help from my DELL support team. The message window that pops up is "Your current security settings prohibit runnings security settings on this page. As a result, the page may not display correctly. What can I do ? At this time I cannot send a picture that's in my signature in outgoing e-mails. Sincerely, Vince :( ...

curve fitting a charging capacitor type curve
Hi all, Newbie to this forum, but need some excel help. I have collected a bunch of data from an object as it heats up. The curve is very similar to a capacitor charging current curve. In my case, manually trying to approximate this curve, I come up with a formula of y= (rise)*(1-exp(-time))+ambient. Is there a way in excel to fit a curve like this or do I need an aftermarket solution? I need something that will use the data points and perform calculations to determine the curve. Thanks, Sean -- mcgradys ------------------------------------------------------------------------ mcgradys&#...

Locking (Protecting) Forms and Controls
Quick question. I appreaciate any response. I have implemented checkboxes within an excel file. These checkboxes have no funciton except visually. I have tried everything I can find but cannot protect their STATE ie(checked, unchecked) I want to be able to distribute this file without allowing users to change the state of the checkboxes. I simply cannot find anything on this. Is it possible? if anybody knows please postback thanks. > Quick question. I appreaciate any response. I have implemented > checkboxes within an excel file. These checkboxes have no funciton > except...

Menu control
Hi, Ive bulit an mfc application that has a window and a menu i would like to insert code that disabels an item in the menu once the the user press ok in a dialog ive built. how can i do it? >Ive bulit an mfc application that has a window and a menu i would like to >insert code that disabels an item in the menu once the the user press ok in >a dialog ive built. >how can i do it? Use the menu editor and add an ON_UPDATE handler for the menu item so that you can enable (and disable) it on some state that you preserve from your dialog action. Dave On Sat, 19 Nov 2005 09:14:...

Excel Solver for Curve Fit
I need to do a curve fit of scatter data in excel. What do I put in the so.ver fields? Why not let XL do the work for you? Trendline coefficients http://www.tushar-mehta.com/excel/tips/trendline_coefficients.htm If you must do it yourself, suppose you have the x and y values in cols. A and B starting with row 2. Designate some cells as the coefficient cells. How many will depend on the kind of equation you are trying to fit. Then, for each x value, compute f(x) using the coefficient cells. Suppose these values are in column C. Then, in, say, column D, calculate the square of the d...

Access combo box control by another data field
Hi, I use a combo box in a form with look-up from a table for selecting data. Easy enough. But, I want to only see a selection of the data in the table, depending on a value in another field in the form. I the combo box table I have ID, data1, and data. data1 is the one that shall be equal to the other field. 1, 1, text1 2, 1, text2 3, 2, texta 4, 2, textb 5, 2, textc etc. I have tried using the standard query that comes with the combo box, and then adding a WHERE statement testing against the data fiel in the form, but it does not work. Any suggestions anyone? Check this link on &...

HELP!!! Control Panel->Mail-> ?
I'm running microsoft outlook 2000. I am not able to setup an outlook profile. I've tried Control panel -> Mail -> but I'm directed to setup an internet connection wizard. I don't see a profiles button. Help! You are probably running Outlook in Internet Mail Only mode. Only Corporate or Workgroup uses profiles. Do you need CW mode? If not, IMO is usually best for home users. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here) virus, all mail sent to my personal account wi...

Attachments in OWA will not download
Attachments in OWA will not download: --- The page cannot be displayed Error Code: Internal Server Error. Not implemented (-2147467263) --- Do not know when this started to happen but at one point in the past we were able to download attachments in OWA but now it does not work. Need help - not too much other useful information was available in Logs. Anyone know how to fix this? Jay Ruyle On Wed, 1 Mar 2006 13:30:39 -0500, "Jay Ruyle" <jaruyle@rhjarchitects.com> wrote: >Attachments in OWA will not download: > >--- >The page cannot be displayed >Error C...

Netfolders-like capabilities and Outlook 2003
I know Netfolders has been discontinued in Outlook 2003, but is it discontinued or just hidden? That is, not part of the default installation. And can it be installed if you just look for it? B/c for all of its hassles, my wife and I use NetFolders as part of our business, and it works 99% of the time. Perhaps every 3 years or so we have to set the folders up for sharing again. We've been using NetFolders since 2000, and it's crapped out only once. But if anyone has found a good solution that's not too expensive (under $100) I would be glad to hear about it. -- ----------------...

Help requested on VBA control
I hope someone here may be able to help, I have an XL sheet with some associated VBA code that runs against a dataset that varies in number although the fields are constant:- (Name) (Next Action) (Last Action) (Time to perform next Action) (Time last action was performed) (Flag 1) (Flag 2) (Unique ID Number) The normal User Form only shows the first 5 items as Flags 1 and 2 are hidden, however I needed to give the user the option to change them which I have done by using an input box with the MSG a string created by looping through N names and having StrMSG = StrMSG + N + Name(N). Thi...

Any Banks Like Ing Direct on the net ?
I am looking for a bank that has 2 way connection that offers a savings account and transfer money from savings to checking. Thanks Joseph, Where are you located? Bank One has what you asked for but not sure you're in their territory. BTW, ING Direct no longer supports 2 way connection and has never had checking accounts (but I suspect you really already knew that). Regards, JB "Joseph A. Zupko" <nonmonitored@sbcglobal.net> wrote in message news:<udLpGVhmEHA.1652@TK2MSFTNGP09.phx.gbl>... > I am looking for a bank that has 2 way connection that offers a ...

set control handle to default visible / invisible, HOWTO?
Hi Everybody, I have following problem. One way or the other I have changed a setting, only I don't know what, where or how, in such a way that when I try to use a shape from a default stencil, the control handles are all hidden. How can you do this, and even better, how can I make them visible again? I can make a shape's control handle visible by editing it's X Behaviour Value and set it to Visible. But one way or the other this has been changed as the default for all Visio. Thanks for any tip and help!! Erwin Are they Network shapes? I think that the control handles are i...

system hang like after every 10 mts
my laptop hangs like after every 10 mimutes when online video are playing and after 1 minutes continues like normal a small circle circules when it hang. even when 2 or 3 flv player run simultaneously. earlier it never had such problem. is the problem b'coz of some video or display driver or the problem is b'coz its been 2.5 yrs i haven't formatted my system, as i don't have an external storage for my data. system: 2 gb ram, 1.6 ghz, dual core, vista virtual memory 3 gb system memory ( c: 7 gb free of 65 gb and e: 2 gb free of 41 gb) i have scanned my s...

Suming Data in a Calculeted Control
Hello, I have a filtered form that I have a calculated control on. The control calculates the differences in days of two dates. How do I get a sum of those caluclations? Thank you. Mark Avis Add a control to the Form Footer section. Set its Control Source to =Sum(xxx), where xxx represents the entire expression in your calculated control (without the =.) For example, if your calculated control uses: =[Date2] - [Date1] you will use: =Sum([Date2] - [Date1]) -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrown...

count number of characters in rich edit control
How can i count number of characters in rich edit control 2 If u mean controls of type Rich TextBox control, try RichControl1 RC1; CString Mes=RC.GetText(); int n=Mes.GetLength(); "Rahul" <Rahul@discussions.microsoft.com> wrote in message news:7743023C-EA83-4ACA-AB67-F1AE7279F1EB@microsoft.com... > How can i count number of characters in rich edit control 2 EM_GETTEXTLENGTHEX, WM_GETTEXTLENGTH, WM_GETTEXT, EM_STREAM* "Rahul" <Rahul@discussions.microsoft.com> wrote in message news:7743023C-EA83-4ACA-AB67-F1AE7279F1EB@microsoft.com... > How can i co...

Excel Mobile doesn't like XL2000 file?
I have Excel 2000 on my laptop & Excel Mobile on my phone (WinMo 6.1, XL Mobile 6.1). The synced file opens and saves fine on my laptop (no conditional formatting or macros). It opens okay on my phone, but doesn't want to save when I close. I get a warning that "unsupported formatting may be lost". I hit SaveAs, give it the same name, and replace the file. It saves as Excel 95/2003. Is there any way around this conflict, short of upgrading to XL2007 on my laptop? Ed >> a warning that "unsupported formatting may be lost" << That message should be re...

new items inqueue notification like outlook desktop alert notify
Would be nice to see built in funtionality that notifies users when new items are submitted to (a) queue(s). Something similar to Outlook's desktop alert notification. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Comm...