displaying wxImage 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
cyrixware
Earned some good credits
Earned some good credits
Posts: 103
Joined: Mon Apr 17, 2006 1:24 pm
Location: Philippines
Contact:

displaying wxImage

Post by cyrixware » Thu May 25, 2006 4:34 am

I create an attached Window using wxDialog. Is this exact codes to display the image? In my frame.cpp I inserted this code:

Code: Select all

frame.cpp

BEGIN_EVENT_TABLE(Frame, wxFrame)
EVT_PAINT(Frame::OnPaint)
END_EVENT_TABLE()

mpCallHistory = new wxDialog(this, -1 , "", wxPoint(appOrigin.x - 325, appOrigin.y + 45), wxSize(200, 490), wxDEFAULT_DIALOG_STYLE);
    
	if(image.LoadFile("res/login.bmp",wxBITMAP_TYPE_BMP))
		
	{	
		//codes

Cursor
Earned some good credits
Earned some good credits
Posts: 120
Joined: Sun Aug 29, 2004 3:09 pm
Location: Grenoble, France
Contact:

Post by Cursor » Thu May 25, 2006 7:22 am

If you want to disply your image in your dialog box, you must handle wxPaintEvent for the dialog and not for the frame.

So derive wxDialog and handle the wxPaintEvent with the same code.
What is little and green, witch go up and down ??
Yoda playing with the force.

cyrixware
Earned some good credits
Earned some good credits
Posts: 103
Joined: Mon Apr 17, 2006 1:24 pm
Location: Philippines
Contact:

Post by cyrixware » Thu May 25, 2006 12:54 pm

yeap... i can display the image already using dialogbox. But if ever i try this for the frame. hehehe never mind... Anyway thanks...

Regards,

cyrixware :D

Post Reply