Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Graphics Display

Graphics Display

Scheduled Pinned Locked Moved C#
graphicsquestionhelptutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    ah_jiang_9
    wrote on last edited by
    #1

    Hi, how can i possibly display graphics object? i created it from a picturebox and i added something to the picture but i have no idea on how to display it as i could not convert it to image or bitmap object to display. Can anyone help? Thanks

    N 1 Reply Last reply
    0
    • A ah_jiang_9

      Hi, how can i possibly display graphics object? i created it from a picturebox and i added something to the picture but i have no idea on how to display it as i could not convert it to image or bitmap object to display. Can anyone help? Thanks

      N Offline
      N Offline
      Nader Elshehabi
      wrote on last edited by
      #2

      Hello

      ah_jiang_9 wrote:

      how can i possibly display graphics object?

      There is a Paint event -or a similar event- that you have to handle in your control to draw whatever you want. In it's PaintEventArg.Graphics you can draw your image as you like. Some controls don't fire this event as they draw there own interface. Yet you can inherit from them or customly draw them. This depends on where you want to draw your graphics object

      ah_jiang_9 wrote:

      i created it from a picturebox and i added something to the picture but i have no idea on how to display it

      Why? It's as simple as these three lines: pictureBox1.Image = new Bitmap(pictureBox1.Width, pictureBox1.Height); //Make a new image in the box Graphics g = Graphics.FromImage(pictureBox1.Image); //Make graphics g.DrawLine(Pens.Black, new Point(5, 5), new Point(30, 30)); //Draw Regards:rose:

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups