wxWidgets: Compiled https://github.com/wxWidgets/wxWidgets/ ... 7398875681 with MT and MTd as static x64 lib
Platform: Windows 10 Home Build 19043 x64
When I call SetBackgroundBitmap, all it does is make the background white instead of gray, my bitmap is not applied. There is no runtime error or warning about the bitmap being not loaded either (which I do get if I specify a non existent bitmap). The bitmap has a resolution of 1280x720 and is not transparent.
Thanks again for the help.
Code: Select all
// For compilers that support precompilation, includes "wx/wx.h".
#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#include <wx/valgen.h>
#include <wx/custombgwin.h>
class MyApp : public wxApp
{
public:
virtual bool OnInit();
};
class MyFrame : public wxFrame
{
public:
wxString Title = "wxTest";
MyFrame();
private:
wxDECLARE_EVENT_TABLE();
};
class MyControlPanel : public wxCustomBackgroundWindow<wxPanel>
{
public:
wxBitmap Wallpaper00 = wxBitmap(L"IDB_WALLPAPER00", wxBITMAP_TYPE_BMP_RESOURCE);
MyControlPanel(wxWindow* parent);
private:
};
wxBEGIN_EVENT_TABLE(MyFrame, wxFrame)
wxEND_EVENT_TABLE()
wxIMPLEMENT_APP(MyApp);
bool MyApp::OnInit()
{
MyFrame* frame = new MyFrame();
frame->Show(true);
return true;
}
MyFrame::MyFrame()
: wxFrame()
{
Create(NULL, wxID_ANY, Title);
SetSizeHints(wxSize(1280, 720), wxSize(1280, 720));
MyControlPanel* ControlPanel = new MyControlPanel(this);
}
MyControlPanel::MyControlPanel(wxWindow* parent)
: wxCustomBackgroundWindow<wxPanel>()
{
Create(parent, wxID_ANY);
SetBackgroundBitmap(Wallpaper00);
}
Code: Select all
#include "wx/msw/wx.rc"
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDB_WALLPAPER00 BITMAP "res\\bmp\\wallpaper_00.bmp"
IDB_WALLPAPER01 BITMAP "res\\bmp\\wallpaper_01.bmp"
IDB_WALLPAPER02 BITMAP "res\\bmp\\wallpaper_02.bmp"
IDB_WALLPAPER03 BITMAP "res\\bmp\\wallpaper_03.bmp"
IDB_WALLPAPER04 BITMAP "res\\bmp\\wallpaper_04.bmp"
IDB_WALLPAPER05 BITMAP "res\\bmp\\wallpaper_05.bmp"
IDB_WALLPAPER06 BITMAP "res\\bmp\\wallpaper_06.bmp"
IDB_WALLPAPER07 BITMAP "res\\bmp\\wallpaper_07.bmp"
IDB_WALLPAPER08 BITMAP "res\\bmp\\wallpaper_08.bmp"
IDB_WALLPAPER09 BITMAP "res\\bmp\\wallpaper_09.bmp"
IDB_WALLPAPER10 BITMAP "res\\bmp\\wallpaper_10.bmp"
IDB_WALLPAPER11 BITMAP "res\\bmp\\wallpaper_11.bmp"
IDB_WALLPAPER12 BITMAP "res\\bmp\\wallpaper_12.bmp"
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
MAINICON ICON "res\\ico\\MAINICON.ico"