newbie graphics

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael

    #1

    newbie graphics

    I found the following method in a graphics turtorial..

    private void DrawShapesForm_ Paint(object sender, PaintEventArgs e)

    {

    // references to object we will use

    Graphics graphicsObject = e.Graphics;

    // ellipse rectangle and gradient brush

    Rectangle drawArea1 = new Rectangle( 5, 35, 30, 100 );

    LinearGradientB rush linearBrush =

    new LinearGradientB rush ( drawArea1, Color.Blue,

    Color.Yellow, LinearGradientM ode.ForwardDiag onal );


    // draw ellipse filled with a blue-yellow gradient

    graphicsObject. FillEllipse( linearBrush, 5, 30, 65, 100 );

    }

    My question is. What code should I put into the click event of
    a command button to get it to execute from there?
    TIA Mick.


  • Peter Duniho

    #2
    Re: newbie graphics

    On Tue, 18 Nov 2008 18:41:12 -0800, Michael <mikharr@bigpon d.comwrote:
    [...]
    My question is. What code should I put into the click event of
    a command button to get it to execute from there?
    None. Just assign that method as the handler for the Paint method of your
    Control or Form. The method will be called as necessary any time there's
    a need to draw the graphics that code represents.

    Pete

    Comment

    Working...