picture slide show flicker and previous image flush problem



Hi guys,

I wrote some code with GTK lib to show the image consequently and here
is my situation.

        use pixbuf to get data from files:
        -pixbuf=gdk_pixbuf_new_from_file(filename, NULL); 
        
        use pixmap to get the mask (for transparent consideration):
        -mask=gdk_pixmap_new(NULL, width, height, 1); 
        -gdk_pixbuf_render_threshold_alpha(pixbuf, mask, 0, 0, 
        0, 0, width, height, 1)
        
        then combine the mask with shown window:
        gdk_window_shape_combine_mask(window->window, mask, 0, 0); 
        
        and crate the image from pixbuf:
        -image=gtk_image_new_from_pixbuf(pixbuf); 
        
        then add to window:
        gtk_container_add((GtkContainer*)window, image); 
        
        
        before every image loading, remove the old one
        gtk_container_remove((GtkContainer*)window, image); 
        
My images are around 2M high definition PNG files. And my running
machine is a ATOM N270 1.6G. Every image will take about 0.3s to load.

My problem is, there are one totally transparent image in my image
files. After showing the total transparent image, before pop out the
next image, it will show the previous image (before the transparent
image) for a very short of time, just like flushing the buffer. 

I was considering the root cause is double buffering. But if I disable
the double buffering feature, the slide show will not be smooth, it
looks flick.

Also I try to disable the X's double buffer extension, but still see
previous image.

Need advice.

Thanks,
Jerry





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]