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. Windows Forms
  4. Problem while drawing the image in picture box

Problem while drawing the image in picture box

Scheduled Pinned Locked Moved Windows Forms
helpgraphicsdata-structures
5 Posts 4 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
    avinashpatil3484
    wrote on last edited by
    #1

    Hello Friends i need help, i m using picture box for drawing the graph. so for that i m using paint event of picture box to draw an image. but problem is that when i minimize the window or any other window come on top then the image gets lost. So wht should i do so that i can get my image afain after maximizng the window And one more thing that is it possible to store the picture box image in any other object. Thanking You All ! Avinash Patil

    A T 2 Replies Last reply
    0
    • A avinashpatil3484

      Hello Friends i need help, i m using picture box for drawing the graph. so for that i m using paint event of picture box to draw an image. but problem is that when i minimize the window or any other window come on top then the image gets lost. So wht should i do so that i can get my image afain after maximizng the window And one more thing that is it possible to store the picture box image in any other object. Thanking You All ! Avinash Patil

      A Offline
      A Offline
      Alan N
      wrote on last edited by
      #2

      Hi, Typically the PictureBox is used to display graphics from a bitmap, metafile, icon, JPEG, GIF, or PNG file. I think you need a graphing control. You may want to look into http://www.codeproject.com/KB/graphics/zedgraph.aspx[^] which I've seen recommended on this forum previously. Alan.

      1 Reply Last reply
      0
      • A avinashpatil3484

        Hello Friends i need help, i m using picture box for drawing the graph. so for that i m using paint event of picture box to draw an image. but problem is that when i minimize the window or any other window come on top then the image gets lost. So wht should i do so that i can get my image afain after maximizng the window And one more thing that is it possible to store the picture box image in any other object. Thanking You All ! Avinash Patil

        T Offline
        T Offline
        Thomas Stockwell
        wrote on last edited by
        #3

        Whenever an event occurs that may disrupt the graphics of the picturebox, be sure to call picturebox1.Invalidate(). This will for the picture to repaint itself. If you are doing custom paint routines it is usually recommended that you create a new custom user control.

        Regards, Thomas Stockwell Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Visit my Blog

        A 1 Reply Last reply
        0
        • T Thomas Stockwell

          Whenever an event occurs that may disrupt the graphics of the picturebox, be sure to call picturebox1.Invalidate(). This will for the picture to repaint itself. If you are doing custom paint routines it is usually recommended that you create a new custom user control.

          Regards, Thomas Stockwell Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Visit my Blog

          A Offline
          A Offline
          avinashpatil3484
          wrote on last edited by
          #4

          Hello Thomas Thanks for replyng Actually problem is that, i want to store the image of picture box in a object so that when it gets repainted because of minimization of picture box or any other window comes above it. So that it will reduce the time to redraw it. And one more thing to tell that while drawing in the picture box, there are near about 400000 points. and because of that its taking so much time. Regards Avinash Patil avinashpatil3484@gmail.com

          V 1 Reply Last reply
          0
          • A avinashpatil3484

            Hello Thomas Thanks for replyng Actually problem is that, i want to store the image of picture box in a object so that when it gets repainted because of minimization of picture box or any other window comes above it. So that it will reduce the time to redraw it. And one more thing to tell that while drawing in the picture box, there are near about 400000 points. and because of that its taking so much time. Regards Avinash Patil avinashpatil3484@gmail.com

            V Offline
            V Offline
            Vivek_India
            wrote on last edited by
            #5

            you could assign the contents of the picture box to a Bitmap Object... manipulate the Bitmap object via setpixel and getpixel and the assign it back to the Picturebox Does this help?

            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