Results 1 to 3 of 3

Thread: drawing tilted ellipse

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2003
    Posts
    2

    Question 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

  2. #2
    Addicted Member NOMADMAN's Avatar
    Join Date
    Aug 2002
    Location
    Closer than you think
    Posts
    237
    hmm thats a tough one, fall back on PSet... Thats my only thought.

    NOMAD

  3. #3
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    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.
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width