473,387 Members | 1,515 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

flicker in wxBufferedPaintDC

Hi,

I actualize a buffer in an event handler routine:

if BUFFERED:
# If doing buffered drawing, create the buffered DC, giving it
# it a real DC to blit to when done.
cdc = wxClientDC(self)
dc = wxBufferedDC(cdc, self.buffer)

dc.BeginDrawing()
if self.image:
dc.DrawBitmap(self.image.ConvertToBitmap(), 0,0)
dc.EndDrawing()

and paint the buffer in the OnPaint method.

def OnPaint(self, event):
if BUFFERED:
# Create a buffered paint DC. It will create the real
# wxPaintDC and then blit the bitmap to it when dc is
# deleted. Since we don't need to draw anything else
# here that's all there is to it.
dc = wxBufferedPaintDC(self, self.buffer)
else:
dc = wxPaintDC(self)
# since we're not buffering in this case, we have to
# paint the whole window, potentially very time consuming.
self.DoDrawing(dc)
but the window is flickering. The window displays the liveimage of a
connected camera.
How could I get rid of the flickering?

Thanks for any hints,

Markus
Jul 18 '05 #1
1 2343

"Markus von Ehr" <vo****@ipm.fhg.de> wrote in message
news:cf**********@news2.rz.uni-karlsruhe.de...
Hi,

I actualize a buffer in an event handler routine:

if BUFFERED:
# If doing buffered drawing, create the buffered DC, giving it
# it a real DC to blit to when done.
cdc = wxClientDC(self)
dc = wxBufferedDC(cdc, self.buffer)

dc.BeginDrawing()
if self.image:
dc.DrawBitmap(self.image.ConvertToBitmap(), 0,0)
dc.EndDrawing()

and paint the buffer in the OnPaint method.

def OnPaint(self, event):
if BUFFERED:
# Create a buffered paint DC. It will create the real
# wxPaintDC and then blit the bitmap to it when dc is
# deleted. Since we don't need to draw anything else
# here that's all there is to it.
dc = wxBufferedPaintDC(self, self.buffer)
else:
dc = wxPaintDC(self)
# since we're not buffering in this case, we have to
# paint the whole window, potentially very time consuming.
self.DoDrawing(dc)
but the window is flickering. The window displays the liveimage of a
connected camera.
How could I get rid of the flickering?

Thanks for any hints,

Markus

You could try using a self.PrepareDC(dc),
or perhaps a wx.SafeYeild(),
or perhaps you need the wx.NO_FULL_REPAINT_ON_RESIZE flag set,
or perhaps you just need to speed up execution , try
http://psyco.sourceforge.net/.

hope this helps.
Tom
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Michael | last post by:
Here is my problem: I have a MDI application and when I load my child forms I get alot of flicker. I have tried to implement double buffering : Public Sub New() MyBase.New() 'This call is...
4
by: Marek Mänd | last post by:
This seems an IE issue only: 4253 bytes testcase: http://www.hot.ee/idaliiga/testcases/ieselect/bnlinkingselectinmsie.htm Can one have 1) a mouseover/mouseout element on TBODY 2) change in...
0
by: mp3boss | last post by:
I am updating a string in the format MM:SS every second using the On_Timer event in Access97 by changing the caption of a label. Even though I'm using 8point text, the box sometimes flickers...
3
by: Per Dunberg | last post by:
Hi all, I have to develop a "skinned" application and I have a problem with the graphics. When a form is loaded and displayed there's aways a flicker where all the controls are located on the...
3
by: seamlyne | last post by:
The first method I ever used for multiple state buttons was to create a graphic for each button for each state: AboutUs_on, AbooutUs_over, AboutUs_out, etc. That works great when there are just a...
17
by: pigeonrandle | last post by:
Hi, I have seen loads of different ways to do this, but the all seem to yield the same result - text that doesn't flicker when it's moving too slowly! Does anyone know 'the best way' to make text...
1
by: Wayne | last post by:
I've noticed some screen flicker when using Access 2003 under Vista and I'm curious as to whether this is a bug or peculiar to my machine. In design view, if I make changes to a form and then...
4
by: Frank Rizzo | last post by:
Hello, I inherited a large Winforms project that is suffering from excessive flicker when switching between portions of the application. I've noticed that most parts of the application (user...
0
by: Rainer Queck | last post by:
Hello NG, I had/have a bad flicker Problem with my Application. On starting some applications, while my app was running, the whole Display started to flicker. Even the desktop Icons! Looking...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.