Flicker
-
how can i remove flicker from my program .. i am trying to make a simple game of tettris (don't know how to spell it correctly). i have to move a shape from top to bottom so my control is doing this for me .. logic i m using is simple ( i think it is) i m using paint function of my control just to fill a perticular block whose value is 1 and and empty whose value is 0 so i need to call paint function after every some time. but Invalidate function is creating flicker. is there any other way i can use or i i can paint some shapes constantly without using paint function ?? i have tried to use some other my own written function but they are not working until i call 'em from paint function of my control what should i do..
-
how can i remove flicker from my program .. i am trying to make a simple game of tettris (don't know how to spell it correctly). i have to move a shape from top to bottom so my control is doing this for me .. logic i m using is simple ( i think it is) i m using paint function of my control just to fill a perticular block whose value is 1 and and empty whose value is 0 so i need to call paint function after every some time. but Invalidate function is creating flicker. is there any other way i can use or i i can paint some shapes constantly without using paint function ?? i have tried to use some other my own written function but they are not working until i call 'em from paint function of my control what should i do..
Look up "Double Buffering".
-
how can i remove flicker from my program .. i am trying to make a simple game of tettris (don't know how to spell it correctly). i have to move a shape from top to bottom so my control is doing this for me .. logic i m using is simple ( i think it is) i m using paint function of my control just to fill a perticular block whose value is 1 and and empty whose value is 0 so i need to call paint function after every some time. but Invalidate function is creating flicker. is there any other way i can use or i i can paint some shapes constantly without using paint function ?? i have tried to use some other my own written function but they are not working until i call 'em from paint function of my control what should i do..
Search Codeproject or the web for System.Windows.Forms.ControlStyles.DoubleBuffer, it will get rid of the 'flashing'/flicker when you draw to a windows form.
Tech, life, family, faith: Give me a visit. I'm currently blogging about: Conversation With a Muslim Judah Himango
-
Search Codeproject or the web for System.Windows.Forms.ControlStyles.DoubleBuffer, it will get rid of the 'flashing'/flicker when you draw to a windows form.
Tech, life, family, faith: Give me a visit. I'm currently blogging about: Conversation With a Muslim Judah Himango
Add these 3 lines to your form constructor // Enable Double Buffering to remove flicker this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.DoubleBuffer, true); Hope this helps Publicjoe C# Tutorial at http://www.publicjoe.f9.co.uk/csharp/tut.html C# Ebook at http://www.publicjoe.f9.co.uk/csharp/samples/ebook.html VB Tutorial at http://www.publicjoe.f9.co.uk/vbnet/vbnet.html VB Ebook at http://www.publicjoe.f9.co.uk/vbnet/samples/ebook.html Mirrors at http://dowhileloop.com/publicjoe/ and http://publicjoe.dowhileloop.com
-
Add these 3 lines to your form constructor // Enable Double Buffering to remove flicker this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.DoubleBuffer, true); Hope this helps Publicjoe C# Tutorial at http://www.publicjoe.f9.co.uk/csharp/tut.html C# Ebook at http://www.publicjoe.f9.co.uk/csharp/samples/ebook.html VB Tutorial at http://www.publicjoe.f9.co.uk/vbnet/vbnet.html VB Ebook at http://www.publicjoe.f9.co.uk/vbnet/samples/ebook.html Mirrors at http://dowhileloop.com/publicjoe/ and http://publicjoe.dowhileloop.com
Or better yet, a single line, with the flags OR'd together: this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true);
Tech, life, family, faith: Give me a visit. I'm currently blogging about: Conversation With a Muslim Judah Himango