Results 1 to 8 of 8

Thread: parallellogram/oval tool -how do I make it???

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Posts
    4

    Unhappy

    Hi!
    Does someone know how to make a (good) oval/ellipse tool in a paint program (some formula with coordinates like StartX, StartY etc)? I have the events mouse down, mouse move, and mouse up for drawing various shapes but the formula for my oval tool is missing!

    -Maarit

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    [object].circle

    use an activeX control and pass in StartX, StartY, EndX, and EndY. This should give you what you need.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Posts
    4

    does it really work?

    Does it really work for an oval? what would the formula be? I can get a circle working but not an oval.

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    you can specify excentricity as the last parameter if i remember correctly.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5
    Fanatic Member Mad Compie's Avatar
    Join Date
    Aug 2000
    Location
    Kuurne (Belgium)
    Posts
    553
    Drawing a circle, ellipse, or arc on an object.

    Syntax

    object.Circle [Step] (x, y), radius, {color, start, end, aspect}

    The Circle method syntax has the following object qualifier and parts.

    Part Description
    object Optional. Object expression that evaluates to an object in the Applies To list. If object is omitted, the Form with the focus is assumed to be object.
    Step Optional. Keyword specifying that the center of the circle, ellipse, or arc is relative to the current coordinates given by the CurrentX and CurrentY properties of object.
    (x, y) Required. Single values indicating the coordinates for the center point of the circle, ellipse, or arc. The ScaleMode property of object determines the units of measure used.
    radius Required. Single value indicating the radius of the circle, ellipse, or arc. The ScaleMode property of object determines the unit of measure used.
    color Optional. Long integer value indicating the RGB color of the circle's outline. If omitted, the value of the ForeColor property is used. You can use the RGB function or QBColor function to specify the color.
    start, end Optional. Single-precision values. When an arc or a partial circle or ellipse is drawn, start and end specify (in radians) the beginning and end positions of the arc. The range for both is -2 pi radians to 2 pi radians. The default value for start is 0 radians; the default for end is 2 * pi radians.
    aspect Optional. Single-precision value indicating the aspect ratio of the circle. The default value is 1.0, which yields a perfect (non-elliptical) circle on any screen.
    Remarks

    To fill a circle, set the FillColor and FillStyle properties of the object on which the circle or ellipse is drawn. Only a closed figure can be filled. Closed figures include circles, ellipses, or pie slices (arcs with radius lines drawn at both ends).
    When drawing a partial circle or ellipse, if start is negative, Circle draws a radius to start, and treats the angle as positive; if end is negative, Circle draws a radius to end and treats the angle as positive. The Circle method always draws in a counter-clockwise (positive) direction.

    The width of the line used to draw the circle, ellipse, or arc depends on the setting of the DrawWidth property. The way the circle is drawn on the background depends on the setting of the DrawMode and DrawStyle properties.
    When drawing pie slices, to draw a radius to angle 0 (giving a horizontal line segment to the right), specify a very small negative value for start, rather than zero.
    You can omit an argument in the middle of the syntax, but you must include the argument's comma before including the next argument. If you omit an optional argument, omit the comma following the last argument you specify.

    When Circle executes, the CurrentX and CurrentY properties are set to the center point specified by the arguments.
    This method cannot be used in an With…End With block.

  6. #6
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Yep.... Mad Compie IS the MSDN, his dark, dark secret. - just kidding of course... or am I? (Evil music plays and lightning flashes)
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  7. #7
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    There is also an API function called 'Ellipse' which will do what you want.
    Harry.

    "From one thing, know ten thousand things."

  8. #8
    Fanatic Member Mad Compie's Avatar
    Join Date
    Aug 2000
    Location
    Kuurne (Belgium)
    Posts
    553
    How did you find that out, Sastraxi? I was indeed the architect for MSDN some time ago. But unfortunately I was not sober those days, hence the bugs.
    I also wear Bill Gates' underwear...

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