How to draw an ellipse with an rotated angle?

S

Shalley

Hello, there,

I have no idea how to draw an ellipse with an rotated
angle. For example, the ellipse's center is (20.0, 50.0),
two conjugate diameter pairs end-point are (35.0, 35.0),
(25.0, 55.0). I hope to use win32 API functions to finish
this drawing. Is it possible?

Please help me giving your suggestion. Tks.
 
J

Jay B. Harlow [MVP - Outlook]

Shalley,
In addition to One Handed Man's comment about Graphics.RotateTransform, you
may need to take into account Graphics.ScaleTransform &
Graphics.TranslateTransform (TranslateTransform more so than
ScaleTransform).

RotateTransform will rotate about the current origin, TranslateTransform
moves the current origin.

I find Charles Petzold's book "Programming Microsoft Windows with Microsoft
Visual Basic .NET" from MS Press to be very helpful in unraveling the
subtleties of GDI+.

Just remember order of operations is important while doing transforms in
GDI+.

Hope this helps
Jay
 
H

Herfried K. Wagner [MVP]

Hello,

Jay B. Harlow said:
Just remember order of operations is important while doing
transforms in GDI+.

That depends on the type of the operations.

;-)
 
J

Jay B. Harlow [MVP - Outlook]

Herfried,
That depends on the type of the operations.
And if you use the MatrixOrder parameter & which MatrixOrder option. ;-)

Later
Jay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top