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