Results 1 to 3 of 3

Thread: [RESOLVED] draw shape using c#

  1. #1

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    Resolved [RESOLVED] draw shape using c#

    hi,
    I want to make a class that draw shapes.


    if my class inherit from forms i can execute code
    VB Code:
    1. this.CreateGraphics();
    but I dont want to inherit the form class.
    my question is what the graphics value that correspond to System.Drawing.Graphics .

    ex . System.Drawing.Graphics g = graphics value

    thanks for the reply.

    Popskie

  2. #2
    PowerPoster sunburnt's Avatar
    Join Date
    Feb 2001
    Location
    Boulder, Colorado
    Posts
    1,403

    Re: draw shape using c#

    If you want to show your drawings on a form or control, you will need to use that control's graphics, and you will want to draw them in that control's OnPaint event using the graphics object provided by the PaintEventArg e.

    If you want to create some graphics that are not visible to the user, for printing or whatever, you need to create a new bitmap/image of the appropriate size, then use Graphics.FromImage() to end up with a new graphics object.

    At least I think

    Good luck!
    Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.

  3. #3

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