Anyone know a good way to draw an Ellipse inside a tilted rectange using CDC?
I know using CDC you can quickly draw an ellipse inside a rectange using the ellipse function. However, the sides of the ellipse's bounding rectangle must be parallel to the screen axes. I need to find a quick/easy way to draw an ellipse inside a bounding rectangle that has been rotated. Anyone have any advice on how I could do this?
Thanks alot for the help guys.
Jeff Sholl
[403 byte] By [
Jeff Sholl] at [2007-11-19 18:28:07]

# 1 Re: Anyone know a good way to draw an Ellipse inside a tilted rectange using CDC?
You need to use coordinate transformations: see SetWorldTransform function.
Alex F at 2007-11-10 3:49:44 >

# 2 Re: Anyone know a good way to draw an Ellipse inside a tilted rectange using CDC?
Yes, you can use SetWorldTransform ( http://windowssdk.msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/cordspac_57cd.asp) like Axel said, however remember that it will only work on Windows NT, 2K, XP or later and not on Windows 9x.
Marc G at 2007-11-10 3:50:44 >

# 4 Re: Anyone know a good way to draw an Ellipse inside a tilted rectange using CDC?
I am not very clear about your questions,mostly,you can call the following codes to draw this shape:
int nSaveDC = pDC->SaveDC();
pDC->BeginPath();
pDC->PolyPolyline(points,(DWORD*)lpPolyCounts,nCount);
pDC->CloseFigure();
pDC->EndPath();
pDC->SelectClipPath(RGN_AND);
I attached a screen shot of drawing an ellipse within a rectangle and rotated,if this is what you need,I think you can try other third-party library,E-XD++ is a good choice,you can found it with:
http://www.ucancode.net/Products/Form2/EXDEntprise.htm
Hope it is useful to you.