-
drawing tilted ellipse
Hello all,
I need to draw an ellipse in a picture box. I am aware of the circle method and also the ellipse win32 API. However, both functions only allow the drawing of a "regular" ellipse (where the bounding box is always an upright rectangle). I need to find something that allows me to draw a "tilted" ellipse.
The information that I am given about each ellipse is the mid-point of each side of the rectangular bounding box, so that the two lines formed by the two pairs of opposite mid-points intersect at the middle of the ellipse. The bounding box might be set at an angle and not align with either the x or y axis.
Any help would be greatly appreciated.
ctse
-
hmm thats a tough one, fall back on PSet... Thats my only thought.
NOMAD
-
use setpixel instead, its much faster.
for angle = 0 to 2*pi
newx=cos(angle)*xrad
newx=newx+(newx-x)*slopex
newy=sin(angle)*yrad
newy=newy+(newy-y)*slopey
'setpixel...
next
i havent tested this code, i just made it in my head so im not sure if it works, but it'll maybe help you a bit.