Code Comments
Programming Forum and web based access to our favorite programming groups.Does anyone know how to do flicker-free animation in GDI+? In GDI, you could define memory device contexts, draw to them, and then blt the result to the actual window context. So far, I've been unable to find a corresponding way of doing things in GDI+ Any ideas?
Post Follow-up to this messageYou can do this in one of two ways. 1. Use automatic double buffering in windows forms. In the constructor or form load event, simply execute this statement this.SetStyle( ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer,true); 2. If you want to do it manually, simply specify a globally scoped Bitmap object, draw to that, then draw the finished image to the screen in one shot. So something like: private Bitmap imgBuffer; ... Graphics g = Graphics.FromImage(this.imgBuffer); Hope that helps, Joel Martinez Orlando .NET User Group http://www.onetug.org http://www.codecube.net "toa" <toalmark@hotmail.com> wrote in message news:<iA3md.7925$rh1.201557@news2.e.nsc.no>.. . > Does anyone know how to do flicker-free animation in GDI+? In GDI, you cou ld > define memory device contexts, draw to them, and then blt the result to th e > actual window context. So far, I've been unable to find a corresponding wa y > of doing things in GDI+ > > Any ideas?
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.