Skip to content
Extraits de code Groupes Projets
Valider e2d75337 rédigé par Niels Martin Hansen's avatar Niels Martin Hansen
Parcourir les fichiers

A bit of simplification of SubtitlesPreview.

Originally committed to SVN as r5788.
parent 8870eac2
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -114,15 +114,10 @@ void SubtitlesPreview::SetText(wxString text) {
////////////////
// Update image
void SubtitlesPreview::UpdateBitmap(int w,int h) {
// Visible?
void SubtitlesPreview::UpdateBitmap() {
if (!IsShownOnScreen()) return;
// Get size
if (w == -1) {
w = GetClientSize().GetWidth();
h = GetClientSize().GetHeight();
}
int w, h;
GetClientSize(&w, &h);
// Delete old bmp if needed
if (bmp) {
......@@ -173,11 +168,8 @@ void SubtitlesPreview::UpdateBitmap(int w,int h) {
}
// Convert frame to bitmap
wxMemoryDC dc(*bmp);
wxBitmap tempBmp(frame.GetImage());
frame.Clear();
dc.DrawBitmap(tempBmp,0,0);
Refresh();
*bmp = wxBitmap(frame.GetImage());
Refresh(false);
}
......@@ -203,7 +195,7 @@ void SubtitlesPreview::OnPaint(wxPaintEvent &event) {
void SubtitlesPreview::OnSize(wxSizeEvent &event) {
delete vid;
vid = NULL;
UpdateBitmap(event.GetSize().GetWidth(),event.GetSize().GetHeight());
UpdateBitmap();
}
......
......@@ -60,7 +60,7 @@ private:
VideoProvider *vid;
wxColour backColour;
void UpdateBitmap(int w=-1,int h=-1);
void UpdateBitmap();
void OnSize(wxSizeEvent &event);
void OnPaint(wxPaintEvent &event);
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter