Recently I added some new icons from the crystal set to my app.
The icons are part of a tool bar in a dialog, in case it make any difference.
One set of PNG images loads and displays OK, the other does not.
I have asked on the wxWidgets forum and the issue seems to relate to the use of wxXmlResource to load the images.
The topic URL is https://forums.wxwidgets.org/viewtopic. ... 37#p180737
The images which cause issues are 'different' in that they are bigger than the ones which do not cause an issue.
I'll attach one copy of either set.
The main reason I am posting here is because I do not know or understand how the PNG files are translated to XML file and thus am unable to decide where to look for a solution to the problem.
Code: Select all
#if 0 wxBitmap wbmTest; wbmTest.LoadFile( _("D:/pkg/wx/MSVC2015/_3.1-2015/wxGTM/rc/edit_add.png"),wxBITMAP_TYPE_PNG ); bool bIsOK = wbmTest.IsOk(); m_toolbarTemplate->AddTool(wxID_ANY, _("Add a row"), wbmTest, wxNullBitmap, wxITEM_NORMAL, _("Add/append a new row"), _("Add/append a new row"), NULL); #else m_toolbarTemplate->AddTool(wxID_ANY, _("Add a row"), wxXmlResource::Get()->LoadBitmap(wxT("edit_add")), wxNullBitmap, wxITEM_NORMAL, _("Add/append a new row"), _("Add/append a new row"), NULL); ..... #endif m_toolbarTemplate->Realize();
The first clause, which loads the file directly, works, the code in the #else clause fails, even though they both load the same file.
And both files pass the test using pngcheck.