Help Required to Create a Bitmap button Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
asi_135
Knows some wx things
Knows some wx things
Posts: 33
Joined: Tue May 30, 2006 6:40 am
Location: pakistan
Contact:

Help Required to Create a Bitmap button

Post by asi_135 » Tue Jun 20, 2006 12:59 pm

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
M.Asif

benedicte
wxWorld Domination!
wxWorld Domination!
Posts: 1409
Joined: Wed Jan 19, 2005 3:44 pm
Location: Paris, France

Post by benedicte » Tue Jun 20, 2006 1:16 pm

Did you call ::wxInitAllImageHandlers() during app startup?

asi_135
Knows some wx things
Knows some wx things
Posts: 33
Joined: Tue May 30, 2006 6:40 am
Location: pakistan
Contact:

Post by asi_135 » Tue Jun 20, 2006 1:31 pm

No i did not call it where should i call it.
M.Asif

benedicte
wxWorld Domination!
wxWorld Domination!
Posts: 1409
Joined: Wed Jan 19, 2005 3:44 pm
Location: Paris, France

Post by benedicte » Tue Jun 20, 2006 1:37 pm

In MyApp::OnInit(). "MyApp" being your class derived from wxApp.

emarti
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 210
Joined: Sat May 07, 2005 8:24 pm
Location: Eskisehir, TURKEY
Contact:

Post by emarti » Tue Jun 20, 2006 1:58 pm

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"));


- T U R K E Y ?
- I love this country!

WebSites:
http://mebt.sourceforge.net/
http://wxquran.sourceforge.net/

Post Reply