| Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next 1 | 1. Flickering Text using wxPaintDC #3343 Posted by: 2004-02-11 05:33:53 | I have a wxFrame with text being painted onto it in my overloaded Paint routine. I am double buffering correctly, with first selecting a wxBitmap into a wxMemoryDC, and then blitting this onto my wxPaintDC. I am also catching EVT_ERASE_BACKGROUND with an empty routine. The problem is, when I change the text that I'm painting onto the screen (re-write the text as some other text), occasionally it flickers on the portion of the screen that the text occupies.
Has anyone else experienced this problem, or know what may be causing it? I want to essentially paint text onto a frame, and then be able to change this text without it flickering (ever). Does anyone have any ideas?
| 2. Re: Flickering Text using wxPaintDC #3346 Posted by: upCASE 2004-02-11 17:53:20 | Hi! Although I don't really have a clue on this, I browsed the mailing list and found that wxNO_FULL_REPAINT_ON_RESIZE style could be able to help. I can't confirm this, but try searching the mailing list yourself. wxPaintDC and flicker offer a lot of hits :) Seems to be a problem with wxWindows. I use DC only on rare occasions, so flickering isn't my worry. I think I read somewhere that with upcoming releases the code for drawing should be improved.
upCASE ----------------------------------- If it was hard to write, it should be hard to read!- Do. Or do not. There is no try! | 3. Re: Flickering Text using wxPaintDC #3347 Posted by: upCASE 2004-02-11 17:54:45 | Hi! Just found that one in the API too wxCLIP_CHILDREN "Use this style to eliminate flicker caused by the background being repainted, then children being painted over them. Windows only." Could this be of help?
upCASE ----------------------------------- If it was hard to write, it should be hard to read!- Do. Or do not. There is no try! | 4. Re: Flickering Text using wxPaintDC #3351 Posted by: upCASE 2004-02-11 21:24:04 | Hi! Another update I just found: There are the following classes http://www.lpthe.jussieu.fr/~zeitlin/wxWindows/docs/wxwin44.htm#wxbuffereddc http://www.lpthe.jussieu.fr/~zeitlin/wxWindows/docs/wxwin45.htm#wxbufferedpaintdc Maybe try them and see if it works. Apparently they where released with 2.4.2 but are missing in the docs. In the 2.5.x docs online they are mentioned.
upCASE ----------------------------------- If it was hard to write, it should be hard to read!- Do. Or do not. There is no try! | 5. Re: Flickering Text using wxPaintDC #3354 Posted by: 2004-02-11 22:32:11 | Thanks upCASE,
Those did fix some other flickering issues, so thanks for the links. I found out what was causing the original problem as well. After I added the wxBufferedPaintDC to my Paint routine (which is quite handy by the way, I highly recommend it), I noticed that behind my text being painted were also some hidden wxStaticTextControls. These were what was flashing. What I was doing was passing text and a font to these controls to calculate a wxSize (bounding box if you will) for my text region, then hiding this wxStaticText and painting the text onto the form. I then managed these wxSize regions to intercept user events, to make my text "clickable" (all this because wxStaticText does not support transparent backgrounds).
Do you know of another way that I could get the size of the area some given text in a given font takes up?
Thanks for your help. | Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next 1 |
|
|