From cecdc64f51602a3af2e5bcc72c218ff01015bdee Mon Sep 17 00:00:00 2001 From: Jonathan Li Date: Wed, 5 Aug 2015 22:07:50 +0100 Subject: [PATCH] Fix dialog screenshot function on Windows wxWidgets 3.0 seems to have a different default device context alpha channel handling on Windows, which makes the screenshot function unusable. As a incomplete fix, remove the alpha channel information from the final image on Windows. Screenshots degrade slightly. --- pcsx2/gui/Dialogs/BaseConfigurationDialog.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pcsx2/gui/Dialogs/BaseConfigurationDialog.cpp b/pcsx2/gui/Dialogs/BaseConfigurationDialog.cpp index d6846c5510..cd1ac34e14 100644 --- a/pcsx2/gui/Dialogs/BaseConfigurationDialog.cpp +++ b/pcsx2/gui/Dialogs/BaseConfigurationDialog.cpp @@ -301,7 +301,17 @@ void Dialogs::BaseConfigurationDialog::OnScreenshot_Click( wxCommandEvent& evt ) if( !filename.IsEmpty() ) { ScopedBusyCursor busy( Cursor_ReallyBusy ); +#ifdef __WXMSW__ + // FIXME: Ideally the alpha channel information should be dealt with + // at the window level. This will do until I have a comprehensive fix + // ready. + wxImage image = memBmp.ConvertToImage(); + if (image.HasAlpha()) + image.ClearAlpha(); + image.SaveFile( filename, wxBITMAP_TYPE_PNG ); +#else memBmp.SaveFile( filename, wxBITMAP_TYPE_PNG ); +#endif } }