video viewer please very very important



Dear all
We are writing an apps to view a video. This video
is loaded from a file and it's stored like RGB
sequence without header.
We made a window, and inside a loop we made a
drawing area but we can't update it: window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
for(int i=0;i<250;i++)
      {
fin.read((gchar*)rgbbuf,IMAGE_WIDTH*IMAGE_HEIGHT*3);
darea=gtk_drawing_area_new();
gtk_widget_set_size_request(darea,IMAGE_WIDTH,IMAGE_HEIGHT); gtk_signal_connect(GTK_OBJECT(darea),"expose-event",GTK_SIGNAL_FUNC(on_darea _expose),NULL); gtk_widget_show_all(window);
gtk_widget_destroy(darea);
} with the on_darea_expose function like this:
gboolean on_darea_expose(GtkWidget
*widget,GdkEventExpose *event, gpointer user_data)
{
gdk_draw_rgb_image(widget->window,widget->style->fg_gc[GTK_STATE_NORMAL],0,0 ,IMAGE_WIDTH,IMAGE_HEIGHT,GDK_RGB_DITHER_MAX,rgbbuf,IMAGE_WIDTH*3);
return TRUE;
} gtk_container_add(GTK_CONTAINER(window),darea);

thanks a lot for your help..

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