can I make zooming in the form itself ?
-
can I make zooming in the form itself ? hi, I have the following problem , I am reading from serial port and draw plots from the serial port in the form and no problem with flicker (I am enable doublebuffersize property) after doing this i does n't have any problem but the problem come when i want to make zooming in the form so I am draw in panel or picturebox but the problem of flicker appear as long as i am extend picturebox as a control and add in the constructor the following method : Code: SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.DoubleBuffer, true); so my question can I make zooming in the form itself if i can not what is the solution for flicker ?
-
can I make zooming in the form itself ? hi, I have the following problem , I am reading from serial port and draw plots from the serial port in the form and no problem with flicker (I am enable doublebuffersize property) after doing this i does n't have any problem but the problem come when i want to make zooming in the form so I am draw in panel or picturebox but the problem of flicker appear as long as i am extend picturebox as a control and add in the constructor the following method : Code: SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.DoubleBuffer, true); so my question can I make zooming in the form itself if i can not what is the solution for flicker ?
Usually flickering occurs from trying to redraw the entire area. Make sure you only invalidate the regions that need to be invalidated instead of the entire control. That is the only way, in GDI+, to control flicker that I have found. If you need really fast drawing code (more than 15FPS) you need to use DirectX or OpenGL.
Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane
-
can I make zooming in the form itself ? hi, I have the following problem , I am reading from serial port and draw plots from the serial port in the form and no problem with flicker (I am enable doublebuffersize property) after doing this i does n't have any problem but the problem come when i want to make zooming in the form so I am draw in panel or picturebox but the problem of flicker appear as long as i am extend picturebox as a control and add in the constructor the following method : Code: SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.DoubleBuffer, true); so my question can I make zooming in the form itself if i can not what is the solution for flicker ?
I guess this is quite obvious, but besides making sure that you only redraw the desired area and not the whole control, make sure that you are not reading from the serial port un the UI thread. Long processes can interfere with the drawing of the form.