Click here to Skip to main content
15,511,131 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: working with pointers Pin
Calin Negru18-Mar-22 1:12
Calin Negru18-Mar-22 1:12 
GeneralRe: working with pointers Pin
Victor Nijegorodov18-Mar-22 2:39
Victor Nijegorodov18-Mar-22 2:39 
GeneralRe: working with pointers Pin
Calin Negru18-Mar-22 11:20
Calin Negru18-Mar-22 11:20 
Generalgoing a bit further: working with pointers Pin
Calin Negru20-Mar-22 8:47
Calin Negru20-Mar-22 8:47 
AnswerRe: working with pointers Pin
Mircea Neacsu18-Mar-22 11:19
mvaMircea Neacsu18-Mar-22 11:19 
QuestionRe: working with pointers Pin
David Crow21-Mar-22 4:16
David Crow21-Mar-22 4:16 
AnswerRe: working with pointers Pin
Calin Negru21-Mar-22 6:15
Calin Negru21-Mar-22 6:15 
QuestionCode to Figure out x,y cords for CDC::Pie inside an CDC::Ellipse given % Pin
ForNow13-Mar-22 10:37
ForNow13-Mar-22 10:37 
hi
Below is the code I have for Drawing a Pie give a percentage thing is it looks nice and I traced a percent of 10.000 however calculation of x & y are negative and it ends up (the pie) being on the left side of the circle

Wondering if I am doing anything wrong after getting to 2 CPoints and I do a CDC:Pie


C++
CPie::CPie(double percentage, PieWnd *pieptr)
{
	
	piecalc(pieptr->currpercent, &piepointstart, pieptr);

	piecalc(percentage, &piepointend, pieptr);

	pieptr->currpercent = percentage;

	/* get corinates for title */
	


}
CPoint *CPie::piecalc(double percent, CPoint *firstpt, PieWnd *pieptr)
{  
	
	double PI = 3.1415926535897931;
	double angle = percent / 100;
	angle = angle * 360;
//	angle = angle * PI / 180;
	
		CRect pierect;

		double radius = pieptr->ellipserect.Height() / 2;
	//	radius = radius * 3.0 / 5.0;
	double offx = (radius * sin(angle));
	double offy = (radius * cos(angle));

	double origx = (pieptr->ellipserect.right + pieptr->ellipserect.left) / 2;
	double origy = (pieptr->ellipserect.top + pieptr->ellipserect.bottom) / 2;

	firstpt->x = origx + offx;
	firstpt->y = origy + offx;
	/* multiple angle by pie */
	return firstp

AnswerRe: Code to Figure out x,y cords for CDC::Pie inside an CDC::Ellipse given % Pin
Mircea Neacsu14-Mar-22 17:41
mvaMircea Neacsu14-Mar-22 17:41 
GeneralRe: Code to Figure out x,y cords for CDC::Pie inside an CDC::Ellipse given % Pin
ForNow15-Mar-22 6:01
ForNow15-Mar-22 6:01 
QuestionIPv6 address compression code using vc++ Pin
Member 1252773510-Mar-22 18:12
Member 1252773510-Mar-22 18:12 
AnswerRe: IPv6 address compression code using vc++ Pin
Victor Nijegorodov10-Mar-22 22:06
Victor Nijegorodov10-Mar-22 22:06 
QuestionQuestions about EM_SETWORDBREAKPROC message and EDITWORDBREAKPROCA function Pin
ForNow10-Mar-22 7:02
ForNow10-Mar-22 7:02 
AnswerRe: Questions about EM_SETWORDBREAKPROC message and EDITWORDBREAKPROCA function Pin
RedDk10-Mar-22 9:22
RedDk10-Mar-22 9:22 
GeneralRe: Questions about EM_SETWORDBREAKPROC message and EDITWORDBREAKPROCA function Pin
ForNow10-Mar-22 10:35
ForNow10-Mar-22 10:35 
GeneralRe: Questions about EM_SETWORDBREAKPROC message and EDITWORDBREAKPROCA function Pin
RedDk10-Mar-22 10:40
RedDk10-Mar-22 10:40 
AnswerRe: Questions about EM_SETWORDBREAKPROC message and EDITWORDBREAKPROCA function Pin
Richard MacCutchan10-Mar-22 23:19
mveRichard MacCutchan10-Mar-22 23:19 
GeneralRe: Questions about EM_SETWORDBREAKPROC message and EDITWORDBREAKPROCA function Pin
ForNow11-Mar-22 2:41
ForNow11-Mar-22 2:41 
GeneralRe: Questions about EM_SETWORDBREAKPROC message and EDITWORDBREAKPROCA function Pin
Richard MacCutchan11-Mar-22 2:51
mveRichard MacCutchan11-Mar-22 2:51 
GeneralRe: Questions about EM_SETWORDBREAKPROC message and EDITWORDBREAKPROCA function Pin
ForNow11-Mar-22 3:13
ForNow11-Mar-22 3:13 
GeneralRe: Questions about EM_SETWORDBREAKPROC message and EDITWORDBREAKPROCA function Pin
Richard MacCutchan11-Mar-22 4:49
mveRichard MacCutchan11-Mar-22 4:49 
GeneralRe: Questions about EM_SETWORDBREAKPROC message and EDITWORDBREAKPROCA function Pin
ForNow11-Mar-22 5:08
ForNow11-Mar-22 5:08 
GeneralRe: Questions about EM_SETWORDBREAKPROC message and EDITWORDBREAKPROCA function Pin
Richard MacCutchan11-Mar-22 5:19
mveRichard MacCutchan11-Mar-22 5:19 
GeneralRe: Questions about EM_SETWORDBREAKPROC message and EDITWORDBREAKPROCA function Pin
ForNow11-Mar-22 5:46
ForNow11-Mar-22 5:46 
GeneralRe: Questions about EM_SETWORDBREAKPROC message and EDITWORDBREAKPROCA function Pin
Richard MacCutchan11-Mar-22 5:54
mveRichard MacCutchan11-Mar-22 5:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.