473,385 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how to avoid flicker when drawing

I am working with C# graphics .I am drawing with elips.
and I have timer that updates the cordinate of scanning line in every 27 milli second.when I start the timer the line starts sweeping the cirlce but at the same time the panal is also vibrating or flickering , which i don't want to do that.
Expand|Select|Wrap|Line Numbers
  1. void t_Tick(object sender, EventArgs e)
  2.         {
  3.             if (conobjcets.START == true)
  4.             {
  5.                 label5.Text = conobjcets.elapsedTime;
  6.  
  7.  
  8.                 splitContainer2.Panel2.Invalidate();
  9.  
  10.  
  11.             }
the obove cod is timer func
Feb 5 '16 #1
1 1810
PsychoCoder
465 Expert Mod 256MB
A coulple things to try, try DoubleBuffered on your panel like so

Expand|Select|Wrap|Line Numbers
  1. this.SetStyle(ControlStyles.AllPaintingInWmPaint |ControlStyles.UserPaint |ControlStyles.DoubleBuffer, true);
  2.  
Or BufferedGraphics similar to this

Expand|Select|Wrap|Line Numbers
  1. System.Drawing.Graphics g = this.CreateGraphics();
  2.         System.Drawing.BufferedGraphicsContext dc = new BufferedGraphicsContext();
  3.         BufferedGraphics backbuffer = dc.Allocate(g, new Rectangle(new Point(0, 0), g.VisibleClipBounds.Size.ToSize()));
  4.         backbuffer.Graphics.DrawImage(Image.FromFile(@"c:\test.jpg"), new Point(10, 10));
  5.         backbuffer.Render(g
  6.  
Mar 1 '16 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Daniel | last post by:
how come when i do oGraphics.FillEllipse it draws blury? is there anyway to adjust this default compression to not be blury when drawing a simple ellipse?
2
by: Anand Ganesh | last post by:
Hi All, In my application I am allowing the user to draw a line. But when the user clicks the start point and starts moving the mouse there is a series of line generated. When the mouse is up...
2
by: mhansemann | last post by:
I'm a C# (but not programming in general) novice, but I couldn't find any answer to this elsewhere. I'm trying to make a text scroll on the form. I thought this was a good example to get started...
1
by: Alessandro Fragnani | last post by:
Hi, I would like to know how to avoid flicker while adding controls to a panel. I couldn´t find any kind of "BeginUpdate/EndUpdate" on it. Thanks in advance Alessandro
6
by: johannblake | last post by:
I am wondering whether it is easy to setup a coordinate system for drawing (using GDI+) that uses meters (or any custom scaling for that matter). Currently, I need to convert from pixels to meters...
4
by: Thomas Richter | last post by:
Hi, I can't get of the black flicker when I resize my form. this = Mainform : System.Windows.Forms.Form If I set the size from 300 to 500 I see for ca 500ms some black areas. I try to solve it...
4
by: Marco Segurini | last post by:
Hi, I am trying to avoid flicker in this situation: 1) I create a simple VB6 Window application (a void form) and I define this code for the form (that has the autoredraw property set to...
3
by: Per Dunberg | last post by:
Hi all, I have to develop a "skinned" application and I have a problem with the graphics. When a form is loaded and displayed there's aways a flicker where all the controls are located on the...
0
by: Blue Apricot | last post by:
I think this is straighforward enough so I don't need sample code, but I will make an example if someone doesn't understand. BACKGROUND: We have built a "skinnable" interface, which uses...
6
by: abdunnabisk | last post by:
I am developing a program in c# where I have to show device connected each other in a dashboard.I am drawing in OnPaint event.when the user move the devices the background is flickering.because each...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.