Click here to Skip to main content
16,011,374 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CFileFind (Maybe I'll get an answer this time) Pin
Michael Martin12-Jul-01 4:18
professionalMichael Martin12-Jul-01 4:18 
GeneralRe: CFileFind (Maybe I'll get an answer this time) Pin
Tomasz Sowinski12-Jul-01 4:25
Tomasz Sowinski12-Jul-01 4:25 
GeneralRe: CFileFind (Maybe I'll get an answer this time) Pin
Michael Dunn12-Jul-01 6:11
sitebuilderMichael Dunn12-Jul-01 6:11 
GeneralDevelop with style Pin
- Emanuele -12-Jul-01 1:59
- Emanuele -12-Jul-01 1:59 
GeneralRe: Develop with style Pin
Tomasz Sowinski12-Jul-01 2:06
Tomasz Sowinski12-Jul-01 2:06 
GeneralRe: Develop with style Pin
NormDroid12-Jul-01 2:09
professionalNormDroid12-Jul-01 2:09 
Generalwhere can find the fastest "LineTO" code? ro how to do! Pin
G.Richard11-Jul-01 23:35
G.Richard11-Jul-01 23:35 
GeneralRe: where can find the fastest Pin
Tomasz Sowinski12-Jul-01 1:01
Tomasz Sowinski12-Jul-01 1:01 
You can draw rotated ellipse using approximation with Bezier segments. The code below may be just what you want (I've extracted it from some old app - found the code on the net); the degrees parameter controls the rotation

void EllipseEx(CDC &dc, int cx, int cy, int rx, int ry, int degrees)
{
	const int Segments = 12;
	const int PointCount = 1 + 3 * Segments;
	const double Alpha = 3.14159265359 / Segments;
	const double Beta = 4 * (1 - cos(Alpha)) / (3 * sin(Alpha));

	double px[PointCount], py[PointCount];
	double Angle, CosA, SinA;

	for (int i = 0; i < Segments; i ++)
	{
		Angle = 2 * i * Alpha;

		CosA = cos(Angle);
		SinA = sin(Angle);
		int k = 3 * i;
		int j = (i == 0) ? 3 * Segments - 1 : k - 1;
				
		px[k] = rx * CosA;
		py[k] = ry * SinA;

		SinA *= Beta * rx; //* SinA;
		CosA *= Beta * ry; //* CosA;

		px[j] = px[k] + SinA;
		py[j] = py[k] - CosA;

		px[k + 1] = px[k] - SinA;
		py[k + 1] = py[k] + CosA;
	}

	px[PointCount - 1] = px[0];
	py[PointCount - 1] = py[0];

	Angle = 2 * 3.1415927 * degrees / 360;
	CosA = cos(Angle); 
	SinA = sin(Angle); 
	
	POINT pt[PointCount];
	for (i = 0; i < PointCount; i ++)
	{
		pt[i].x = cx + (LONG)(0.5 + px[i] * CosA - py[i] * SinA);
		pt[i].y = cy + (LONG)(0.5 + px[i] * SinA + py[i] * CosA);
	}

	PolyBezier(dc, pt, PointCount); 
}


Tomasz Sowinski -- http://www.shooltz.com
GeneralRe: where can find the fastest Pin
G.Richard12-Jul-01 20:01
G.Richard12-Jul-01 20:01 
GeneralRe: where can find the fastest Pin
Tomasz Sowinski12-Jul-01 23:44
Tomasz Sowinski12-Jul-01 23:44 
GeneralTranspareten window -(CBitmap::BitBlt) Pin
11-Jul-01 23:12
suss11-Jul-01 23:12 
GeneralRe: Transpareten window -(CBitmap::BitBlt) Pin
Tomasz Sowinski12-Jul-01 1:11
Tomasz Sowinski12-Jul-01 1:11 
GeneralRe: Transpareten window -(CBitmap::BitBlt) Pin
12-Jul-01 1:40
suss12-Jul-01 1:40 
GeneralError ... Pin
12-Jul-01 2:33
suss12-Jul-01 2:33 
GeneralRe: Error ... Pin
Tomasz Sowinski12-Jul-01 2:42
Tomasz Sowinski12-Jul-01 2:42 
GeneralRe: Error ... Pin
12-Jul-01 3:16
suss12-Jul-01 3:16 
GeneralRe: Error ... Pin
Tomasz Sowinski12-Jul-01 3:31
Tomasz Sowinski12-Jul-01 3:31 
GeneralMemory monitoring Pin
Geetha11-Jul-01 22:38
Geetha11-Jul-01 22:38 
GeneralRe: Memory monitoring Pin
Tomasz Sowinski12-Jul-01 1:25
Tomasz Sowinski12-Jul-01 1:25 
GeneralUsing of one object in three dialog ... Pin
Hadi Rezaee11-Jul-01 22:37
Hadi Rezaee11-Jul-01 22:37 
GeneralRe: Using of one object in three dialog ... Pin
Tomasz Sowinski12-Jul-01 1:07
Tomasz Sowinski12-Jul-01 1:07 
GeneralRe: Using of one object in three dialog ... Pin
Hadi Rezaee12-Jul-01 2:15
Hadi Rezaee12-Jul-01 2:15 
GeneralRe: Using of one object in three dialog ... Pin
Tomasz Sowinski12-Jul-01 2:36
Tomasz Sowinski12-Jul-01 2:36 
GeneralRe: Using of one object in three dialog ... Pin
Hadi Rezaee12-Jul-01 4:18
Hadi Rezaee12-Jul-01 4:18 
GeneralRe: Using of one object in three dialog ... Pin
Tomasz Sowinski12-Jul-01 4:24
Tomasz Sowinski12-Jul-01 4:24 

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.