diff --git a/aegisub/src/colour_button.cpp b/aegisub/src/colour_button.cpp index 7483aa1d7..60925454b 100644 --- a/aegisub/src/colour_button.cpp +++ b/aegisub/src/colour_button.cpp @@ -21,7 +21,7 @@ #include "compat.h" #include "dialog_colorpicker.h" -#include +#include wxDEFINE_EVENT(EVT_COLOR, wxThreadEvent); @@ -45,9 +45,8 @@ ColourButton::ColourButton(wxWindow *parent, wxSize const& size, bool alpha, agi } void ColourButton::UpdateBitmap() { - wxMemoryDC dc; - dc.SelectObject(bmp); - dc.SetBrush(wxBrush(to_wx(colour))); - dc.DrawRectangle(0, 0, bmp.GetWidth(), bmp.GetHeight()); + using namespace boost::gil; + fill_pixels(interleaved_view(bmp.GetWidth(), bmp.GetHeight(), (bgr8_pixel_t*)bmp.GetData(), 3 * bmp.GetWidth()), + bgr8_pixel_t(colour.r, colour.g, colour.b)); SetBitmapLabel(bmp); } diff --git a/aegisub/src/colour_button.h b/aegisub/src/colour_button.h index 2a334352d..a35a9821a 100644 --- a/aegisub/src/colour_button.h +++ b/aegisub/src/colour_button.h @@ -25,7 +25,7 @@ wxDECLARE_EVENT(EVT_COLOR, wxThreadEvent); /// A button which displays a currently-selected color and lets the user pick /// a new color when clicked class ColourButton: public wxButton { - wxBitmap bmp; ///< The button's bitmap label + wxImage bmp; ///< The button's bitmap label agi::Color colour; ///< The current colour /// Update the bitmap label after the color is changed