Can someone tell me how I can draw a diagonal or slanted oval on my form? I know DrawEllipse draws circles that are either straight vertical or straight horizontal....

2
Contributors
4
Replies
5
Views
10 Years
Discussion Span
Last Post by iamthwee

Thanks! I got everything to work.

Hi again.

I was wrong. I thought I had it, but I can't figure out how to convert this code (as I'm not using MFC):

for (int i = Cnt-1; i>=0; --i)
{
vCtlPt[i] = (LDPoint(   vCtlPt[i].x * cosAng + vCtlPt[i].y * sinAng,
-vCtlPt[i].x * sinAng + vCtlPt[i].y * cosAng) + constTerm).GetCPoint();
}

Can anyone help pls?

Don't quote me on this, because it's just a guess but I see it like thus:-

for (int i = Cnt-1; i>=0; --i)
{
vCtlPt[i] = (LDPoint(   vCtlPt[i].x * cosAng + vCtlPt[i].y * sinAng,
-vCtlPt[i].x * sinAng + vCtlPt[i].y * cosAng) + constTerm).GetCPoint();
}

vCtlPt is obviously an array of points, those 12 which you define at the beginning to be exact.

LDPoint (   );

is obviously some function, my guess is it plots a point on a 2d canvas in MFC

int i = Cnt-1; i>=0; --i)

The above line just goes through each array of points i.e

vCtlPt[11]
vCtlPt[10]
.
.
.
vCtlPt[1]

One other thing to be aware of is that the angle is defined in radians as opposed to degrees. I.e 360 ^\circ = 2 \pi radians?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.