tips for displaying a sequence of images quickly without flicker?

I think wx.BufferedDC is what you need. It's a while since I've used it, so I don't have any sample code for you; try Google.

Phil

···

At 01:44 PM 6/14/2008, you wrote:

I'm trying to make a sequence of images show on the screen, about 5 per second. The problem is when one image moves to the next there's noticeable flicker. I set the background color to black and set panel.SetBackgroundStyle(wx.BG_STYLE_CUSTOM), which both help to lessen the impact of the flickering, but still there's a noticeable flicker as the images are redrawn on the screen.

I'm wondering what the best practice for avoiding flicker is? I thought about drawing the next image in the background, and then hiding the topmost image, and cycling through 3 or 4 bitmap widgets in this manner?

Or is there some other way?

As an example of a program that does this well, have a look at Iranview on Windows. If you hold the right-arrow key it cycles through all the pictures in a directory without any flicker.

My images are simple bitmap objects:

bmp = wx.Bitmap("pic1.jpg", wx.BITMAP_TYPE_JPEG)
bigpic = wx.StaticBitmap(panel, -1, bmp, pos=(0,0), size=(1024, 768) )

Thanks for any help.