Page 1 of 1

How can I add bitmap to dialog?

Posted: Tue Sep 22, 2020 12:08 pm
by AndrzejB
I try own message box like wxMessageBox.
How can I add bitmap to dialog?
is posssible add bitmap to button:

Code: Select all

 const wxSize imageSize(32, 32);
    wxImageList*  m_imageList = new wxImageList();
    m_imageList = new wxImageList(imageSize.GetWidth(), imageSize.GetHeight());
            Add(wxArtProvider::GetIcon(wxART_INFORMATION, wxART_OTHER, imageSize));
            Add(wxArtProvider::GetIcon(wxART_QUESTION, wxART_OTHER, imageSize));
            Add(wxArtProvider::GetIcon(wxART_WARNING, wxART_OTHER, imageSize));
            Add(wxArtProvider::GetIcon(wxART_ERROR, wxART_OTHER, imageSize));
    wxBoxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
    wxButton *button = new wxButton(this, 1, "");
I try using panel after correcting "wxImagePanel: public wxPanel" and "wxImagePanel(wxWindow* parent, wxString file, wxBitmapType format)" I don't see image on this panel.

Re: How can I add bitmap to dialog?

Posted: Tue Sep 22, 2020 1:00 pm
by PB
If the bitmap is relatively small and you do not need to scale it, I recommend taking a look at wxStaticBitmap control.