Click here to Skip to main content
15,891,529 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSorting a user class based CArray Pin
al25003-Jul-07 19:31
al25003-Jul-07 19:31 
AnswerRe: Sorting a user class based CArray Pin
Stephen Hewitt3-Jul-07 19:55
Stephen Hewitt3-Jul-07 19:55 
QuestionMy registered activex control is corrupted or missing. Pin
adityarao313-Jul-07 18:35
adityarao313-Jul-07 18:35 
QuestionRTTI option in compiler Pin
vibindia3-Jul-07 17:30
vibindia3-Jul-07 17:30 
AnswerRe: RTTI option in compiler Pin
User 5838523-Jul-07 17:36
User 5838523-Jul-07 17:36 
AnswerRe: RTTI option in compiler Pin
Rajkumar R3-Jul-07 18:22
Rajkumar R3-Jul-07 18:22 
AnswerRe: RTTI option in compiler Pin
Stephen Hewitt3-Jul-07 18:24
Stephen Hewitt3-Jul-07 18:24 
QuestionA Fast Bresenham Type Algorithm For Drawing Ellipse Pin
KienNT783-Jul-07 17:20
KienNT783-Jul-07 17:20 
I read "A Fast Bresenham Type Algorithm For Drawing Ellipse" by John Kennedy Mathematics Department.
Below function was developed base on above algorithm.
I want to ask someone help me, how can develop below function to rotate ellipse.
If someone have an other ideals, can you help me!
<br />
void CBGraphics::DrawEllipse(HDC hDC, int x1, int y1, int x2, int y2, COLORREF color)<br />
{<br />
        long x, y, XChange, YChange, EllipseError, TwoASquare, TwoBSquare, StoppingX, StoppingY;	<br />
	TwoASquare = 2 * x2 * x2;<br />
	TwoBSquare = 2 * y2 * y2;<br />
	x = x2;<br />
	y = 0;<br />
	XChange = y2 * y2 * (1 - 2 * x2);<br />
	YChange = x2 * x2;<br />
	EllipseError = 0;<br />
	StoppingX = TwoBSquare * x2;<br />
	StoppingY = 0;<br />
	while( StoppingX >= StoppingY)<br />
	{<br />
		Put4Pixel(hDC, x1, y1, x, y, color);<br />
		y++;<br />
		StoppingY += TwoASquare;<br />
		EllipseError += YChange;<br />
		YChange += TwoASquare;<br />
		if( ( 2 * EllipseError + XChange) > 0 )<br />
		{<br />
			x--;<br />
			StoppingX -= TwoBSquare;<br />
			EllipseError += XChange;<br />
			XChange += TwoBSquare;<br />
		}<br />
	}<br />
	x = 0;<br />
	y = y2;<br />
	XChange = y2 * y2;<br />
	YChange = x2 * x2 * (1 - 2 * y2);<br />
	EllipseError = 0;<br />
	StoppingX = 0;<br />
	StoppingY = TwoASquare * y2;<br />
	while (StoppingX <= StoppingY)<br />
	{<br />
		Put4Pixel(hDC, x1, y1, x, y, color);<br />
		x++;<br />
		StoppingX += TwoBSquare;<br />
		EllipseError += XChange;<br />
		XChange += TwoBSquare;<br />
		if( (2 * EllipseError + YChange) > 0)<br />
		{<br />
			y--;<br />
			StoppingY -= TwoASquare;<br />
			EllipseError += YChange;<br />
			YChange += TwoASquare;<br />
		}<br />
	}<br />
}<br />

AnswerRe: A Fast Bresenham Type Algorithm For Drawing Ellipse Pin
Rajkumar R3-Jul-07 19:22
Rajkumar R3-Jul-07 19:22 
GeneralRe: A Fast Bresenham Type Algorithm For Drawing Ellipse [modified] Pin
KienNT783-Jul-07 20:53
KienNT783-Jul-07 20:53 
Questionmonitoring user connections in my PC Pin
m-a-s-a-k-i-t-o-n3-Jul-07 15:35
m-a-s-a-k-i-t-o-n3-Jul-07 15:35 
QuestionRe: monitoring user connections in my PC Pin
David Crow3-Jul-07 18:10
David Crow3-Jul-07 18:10 
AnswerRe: monitoring user connections in my PC Pin
m-a-s-a-k-i-t-o-n3-Jul-07 22:16
m-a-s-a-k-i-t-o-n3-Jul-07 22:16 
QuestionCustom Vector Allocator Pin
miketra3-Jul-07 10:04
miketra3-Jul-07 10:04 
AnswerRe: Custom Vector Allocator Pin
Maximilien3-Jul-07 10:31
Maximilien3-Jul-07 10:31 
GeneralVector Function erase() Pin
miketra3-Jul-07 10:55
miketra3-Jul-07 10:55 
GeneralRe: Vector Function erase() Pin
Stephen Hewitt3-Jul-07 13:59
Stephen Hewitt3-Jul-07 13:59 
QuestionHow to prevent CMainFrame from restores???? Pin
SandipG 3-Jul-07 9:22
SandipG 3-Jul-07 9:22 
AnswerRe: How to prevent CMainFrame from restores???? Pin
MANISH RASTOGI3-Jul-07 18:46
MANISH RASTOGI3-Jul-07 18:46 
Questionruntime type casting Pin
wallbrick3-Jul-07 6:00
wallbrick3-Jul-07 6:00 
AnswerRe: runtime type casting Pin
Matthew Faithfull3-Jul-07 6:18
Matthew Faithfull3-Jul-07 6:18 
AnswerRe: runtime type casting Pin
led mike3-Jul-07 6:22
led mike3-Jul-07 6:22 
AnswerRe: runtime type casting Pin
Nuxser3-Jul-07 15:59
Nuxser3-Jul-07 15:59 
AnswerRe: runtime type casting Pin
Nuxser3-Jul-07 16:17
Nuxser3-Jul-07 16:17 
Questionget Distinguished Email id from GAL Pin
Ganesh_T3-Jul-07 5:47
Ganesh_T3-Jul-07 5:47 

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.