GIDForums  

Go Back   GIDForums > Computer Programming Forums > .NET Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 21-Feb-2008, 13:27
patrickH80 patrickH80 is offline
New Member
 
Join Date: Dec 2006
Posts: 3
patrickH80 is on a distinguished road
Unhappy

How to avoid flicker effect


Hi,

I wrote an application where you can create your own graph by adding
curve points into a coordinate system grid. I create a Panel and draw everything on it.

Also you can pick the control points and drag them to another
spot. If I do so, I get such a bad flicker effect (only in the panel)
and sometimes the whole background is blank.

my paint method looks like this:

C-SHARP / C# Code:
private void PaintTF(object sender, PaintEventArgs e) 
{ 
Graphics g = e.Graphics; 
Graphics.FromImage(myBitmap).Clear(System.Drawing.Color.LightGray); 
Graphics bufferedGraphics = 
Graphics.FromImage(myBufferBitmap); 
bufferedGraphics.DrawImage(myBitmap, 0, 0); 

bufferedGraphics.DrawAllTheStuff.... 

g.DrawImage(myBufferBitmap, 0, 0); 
bufferedGraphics.Dispose(); 
}

And in the MouseMove method i do Panel.Refresh(). I also tried overriding the this.OnPaintBackground and this.OnPaint but then my graph gets drawn behind the panel but it is supposed to be on the panel. If anybody can help me with that, I would be so happy.

cheers,
patrick
Last edited by LuciWiz : 23-Feb-2008 at 12:52. Reason: Please insert your C# code between [c#] & [/c#] tags
 
 

Recent GIDBlogWelcome to Baghdad by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Globalizing member variables to avoid passing to member functions... jondean C++ Forum 13 14-Aug-2006 00:44
Re: Things to Avoid in C/C++ -- system("pause"), Part 4 WaltP C Programming Language 2 26-Apr-2006 15:41
DirectX flicker Error C++ Forum 3 06-Nov-2005 19:21
Re: Things to Avoid in C/C++ -- void main(), Part 10 WaltP C Programming Language 0 18-Oct-2005 20:25
Re: Things to Avoid in C/C++ -- scanf, Part 5 WaltP C Programming Language 0 20-Sep-2005 19:40

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 00:14.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.