Hi All, I am having difficulty with a new image refreshing. I have a video running under wxMediaCtrl, at the same time ffmpeg is taking a snapshot of the video, which is displayed in a wxScrolledWindow on the right. Ffmpeg is running in a separate thread which has not yet completed taking the snap, so I temporarily use an empty bitmap with some text saying "don't panic" or it's equivalent. However when this temporary bitmap is displayed, it shows two partial images. A previous image plus part of the one I am trying to show. If I then flick between screen and flick back, the correct image is shown.
This is clearly a repaint problem and maybe to do with wxScrolledWindow, because I see some special code for wxScrolledWindow around Drawing and DCs. I was hoping there was some simple sort of "force repaint" command but I can't see it. Here is the code in question (following) Regards Steve # # Display thumbnail and controls in scrolling window. # Pass: $self, filename (without path or suffix) as parameters , sequence as global variable in $gl_edit_mode, my $self = shift; # Pass $self my $loc_file_name = shift; # Pass filename my $loc_title = shift; # Pass file name # Create thumbnail space $self->{"Ctl_Video_Tab_Video_".$gl_edit_mode."_Bmp"} = Wx::StaticBitmap->new($self->{Ctl_Post_Exam_Videos_Pane_2}, 6000000+$gl_edit_mode, # Wx::Bitmap->new("media\\". $loc_file_name .".jpg", wxBITMAP_TYPE_ANY), wxDefaultPosition, wxDefaultSize, ); Wx::Bitmap->new("media\\empty_item.jpg", wxBITMAP_TYPE_ANY), wxDefaultPosition, wxDefaultSize, ); $self->{"Ctl_Video_Tab_Video_".$gl_edit_mode."_Bmp"}->SetMinSize(Wx::Size->n ew(152, 142)); # Create sizers $self->{Ctl_Post_Exam_Videos_Grid_Sizer_3}->Add($self->{"Ctl_Video_Tab_Video _".$gl_edit_mode."_Bmp"}, 0, 0, 0); $self->{"Ctl_Post_Exam_Videos_Sizer_6_".$gl_edit_mode} = Wx::BoxSizer->new(wxHORIZONTAL); $self->{Ctl_Post_Exam_Videos_Grid_Sizer_3}->Add($self->{"Ctl_Post_Exam_Video s_Sizer_6_".$gl_edit_mode}, 1, wxEXPAND, 0); # Add title $self->{"Ctl_Video_Tab_Title_".$gl_edit_mode."_Txt"} = Wx::TextCtrl->new($self->{Ctl_Post_Exam_Videos_Pane_2}, wxID_ANY, $loc_title, wxDefaultPosition, wxDefaultSize, ); $self->{"Ctl_Post_Exam_Videos_Sizer_6_".$gl_edit_mode}->Add($self->{"Ctl_Vid eo_Tab_Title_".$gl_edit_mode."_Txt"}, 0, , 0); # Add play button $self->{"Ctl_Video_Tab_Play_".$gl_edit_mode."_Btn"} = Wx::BitmapButton->new($self->{Ctl_Post_Exam_Videos_Pane_2}, 1000000+$gl_edit_mode, Wx::Bitmap->new("Images\\play.png", wxBITMAP_TYPE_ANY)); $self->{"Ctl_Video_Tab_Play_".$gl_edit_mode."_Btn"}->SetSize($self->{"Ctl_Vi deo_Tab_Play_".$gl_edit_mode."_Btn"}->GetBestSize()); $self->{"Ctl_Post_Exam_Videos_Sizer_6_".$gl_edit_mode}->Add($self->{"Ctl_Vid eo_Tab_Play_".$gl_edit_mode."_Btn"}, 0, , 0); # Add event to activate play button Wx::Event::EVT_BUTTON( $self, $self->{"Ctl_Video_Tab_Play_".$gl_edit_mode."_Btn"}, \&on_media_select ); # Add delete button $self->{"Ctl_Video_Tab_Delete_".$gl_edit_mode."_Btn"} = Wx::BitmapButton->new($self->{Ctl_Post_Exam_Videos_Pane_2}, 2000000+$gl_edit_mode, Wx::Bitmap->new("Images\\pop_big_colose_n.bmp", wxBITMAP_TYPE_ANY)); $self->{"Ctl_Video_Tab_Delete_".$gl_edit_mode."_Btn"}->SetMinSize(Wx::Size-> new(24, 24)); $self->{"Ctl_Post_Exam_Videos_Sizer_6_".$gl_edit_mode}->Add($self->{"Ctl_Vid eo_Tab_Delete_".$gl_edit_mode."_Btn"}, 0, , 0); # Add event to activate delete button Wx::Event::EVT_BUTTON( $self, $self->{"Ctl_Video_Tab_Delete_".$gl_edit_mode."_Btn"}, \&on_media_delete ); $self->{Ctl_Post_Exam_Videos_Grid_Sizer_3}->Layout(); } <blocked::mailto:steve.cook...@sca-uk.com> --~--~---------~--~----~------------~-------~--~----~ Please read http://www.wxwidgets.org/support/mlhowto.htm before posting. To unsubscribe, send email to wx-users+unsubscr...@googlegroups.com or visit http://groups.google.com/group/wx-users -~----------~----~----~----~------~----~------~--~---
<<Blank Bkgrd.gif>>