EFileTahi-A Posted December 24, 2007 Posted December 24, 2007 I'm using a panel to draw my GDI+ graphics but sometimes the panel flickers to its predefined back color. How can I disable the a panel's painting / refresh function? Quote
Leaders snarfblam Posted December 27, 2007 Leaders Posted December 27, 2007 What sort of graphics are these? Double buffering will probably help, especially if you are animating something. Just render your graphics to a Bitmap and when you are done draw it to the panel (the easiest way to do this is by setting the bitmap as the panel's background image and invalidating the panel with the bitmap's bounds when you want to refresh the image). Quote [sIGPIC]e[/sIGPIC]
EFileTahi-A Posted December 30, 2007 Author Posted December 30, 2007 I'm already using double buffering (rendering to a bitmap and then showing all the graphics when done, I'm also using manual painting). As I said, it flickers only occasionally, like 3 times per minute or so, without double buffering it flickers every millisecond :) Anyway, is there any way to disable the panels refresh, invalidate, paint event, calls? I don't know, it seems to me that its a refresh issue, as with manage DX where we need also to disable the form's refresh. Unfortunately that seems to have no effect on this problem of mine. PS: I noticed that this happens specially when the OS displays some system messages like when we receive a pop-msn from message about receiving a new email... weird... Quote
Leaders snarfblam Posted December 31, 2007 Leaders Posted December 31, 2007 Have you tried inheriting the panel class and overriding the OnPaint and/or OnInvalidated methods? Quote [sIGPIC]e[/sIGPIC]
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.