Page 1 of 1

Help Required to Create a Bitmap button

Posted: Tue Jun 20, 2006 12:59 pm
by asi_135
Dear All,
i want to creat a bitmap button and i have used the wxBitmap Class to load a bitmap and then used the wxBitmapButton and creat an object of a button to load a bitmap on it .but it gives and error i.e No Type handler defiend for the bitmap any body can help .THanks
M.Asif

Posted: Tue Jun 20, 2006 1:16 pm
by benedicte
Did you call ::wxInitAllImageHandlers() during app startup?

Posted: Tue Jun 20, 2006 1:31 pm
by asi_135
No i did not call it where should i call it.

Posted: Tue Jun 20, 2006 1:37 pm
by benedicte
In MyApp::OnInit(). "MyApp" being your class derived from wxApp.

Posted: Tue Jun 20, 2006 1:58 pm
by emarti

Code: Select all


wxBitmap bmp;
bmp.LoadFile(_T("any.bmp", wxBITMAP_TYPE_BMP);

wxBitmapButton*  WxBitmapButton = new wxBitmapButton(this, wxID_ANY, bmp, wxPoint(144,144), wxSize(105,41), wxBU_AUTODRAW, wxDefaultValidator, _T("WxBitmapButton"));